[MM-36472] Fix inconsistencies in Roles columns (#18390)
* Fix inconsistencies in Roles columns * Add new migrations
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
305e4793c3
Коммит
177680f08c
@@ -98,7 +98,6 @@ func TeamMemberWithErrorToString(o *TeamMemberWithError) string {
|
||||
}
|
||||
|
||||
func (o *TeamMember) IsValid() *AppError {
|
||||
|
||||
if !IsValidId(o.TeamId) {
|
||||
return NewAppError("TeamMember.IsValid", "model.team_member.is_valid.team_id.app_error", nil, "", http.StatusBadRequest)
|
||||
}
|
||||
@@ -107,6 +106,11 @@ func (o *TeamMember) IsValid() *AppError {
|
||||
return NewAppError("TeamMember.IsValid", "model.team_member.is_valid.user_id.app_error", nil, "", http.StatusBadRequest)
|
||||
}
|
||||
|
||||
if len(o.Roles) > UserRolesMaxLength {
|
||||
return NewAppError("TeamMember.IsValid", "model.team_member.is_valid.roles_limit.app_error",
|
||||
map[string]interface{}{"Limit": UserRolesMaxLength}, "", http.StatusBadRequest)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user