MM-11703: Update incoming and outgoing webhook description to 500 characters (#9265)
* MM-11703: Update incoming and outgoing webhook description to 500 characters * MM-11703: Add upgrade code * MM-11703: Remove MAX_DESCRIPTION_LENGTH constants * MM-11703: GOFMT * MM-11703: Move upgrade code to version 5.3 * MM-11703: Comment back upgrade to 5.3.0 * MM-11703: Add API errors back * MM-11703: Copy-Paste
Этот коммит содержится в:
коммит произвёл
Carlos Tadeu Panato Junior
родитель
30fa6eca69
Коммит
50af3a19a2
@@ -93,7 +93,7 @@ func (o *IncomingWebhook) IsValid() *AppError {
|
||||
return NewAppError("IncomingWebhook.IsValid", "model.incoming_hook.display_name.app_error", nil, "", http.StatusBadRequest)
|
||||
}
|
||||
|
||||
if len(o.Description) > 128 {
|
||||
if len(o.Description) > 500 {
|
||||
return NewAppError("IncomingWebhook.IsValid", "model.incoming_hook.description.app_error", nil, "", http.StatusBadRequest)
|
||||
}
|
||||
|
||||
|
||||
@@ -80,12 +80,12 @@ func TestIncomingWebhookIsValid(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
o.Description = strings.Repeat("1", 129)
|
||||
o.Description = strings.Repeat("1", 501)
|
||||
if err := o.IsValid(); err == nil {
|
||||
t.Fatal("should be invalid")
|
||||
}
|
||||
|
||||
o.Description = strings.Repeat("1", 128)
|
||||
o.Description = strings.Repeat("1", 500)
|
||||
if err := o.IsValid(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ func (o *OutgoingWebhook) IsValid() *AppError {
|
||||
return NewAppError("OutgoingWebhook.IsValid", "model.outgoing_hook.is_valid.display_name.app_error", nil, "", http.StatusBadRequest)
|
||||
}
|
||||
|
||||
if len(o.Description) > 128 {
|
||||
if len(o.Description) > 500 {
|
||||
return NewAppError("OutgoingWebhook.IsValid", "model.outgoing_hook.is_valid.description.app_error", nil, "", http.StatusBadRequest)
|
||||
}
|
||||
|
||||
|
||||
@@ -102,14 +102,14 @@ func TestOutgoingWebhookIsValid(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
o.Description = strings.Repeat("1", 129)
|
||||
o.Description = strings.Repeat("1", 501)
|
||||
if err := o.IsValid(); err == nil {
|
||||
t.Fatal("should be invalid")
|
||||
}
|
||||
|
||||
o.Description = strings.Repeat("1", 128)
|
||||
o.Description = strings.Repeat("1", 500)
|
||||
if err := o.IsValid(); err != nil {
|
||||
t.Fatal("should be invalid")
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
o.ContentType = strings.Repeat("1", 129)
|
||||
|
||||
Ссылка в новой задаче
Block a user