[MM-13671] Rework Team InviteId Creation and Updates (#10536)
* Add regenerate invite ID endpoint; Dont allow inviteID updates via other methods; Remove unrequired checks in get handler * Fix tests; Dont accept TeamId as invite ID * Ensure all teams have an InviteID set * Custom Selector to get empty teams; dont crash when inviteid set fails * Remote InviteId from TeamPatch * Add missing translation * Translation string order * Use sync store * gofmt
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
ec95793b90
Коммит
f7982216e4
@@ -49,7 +49,6 @@ type TeamPatch struct {
|
||||
Description *string `json:"description"`
|
||||
CompanyName *string `json:"company_name"`
|
||||
AllowedDomains *string `json:"allowed_domains"`
|
||||
InviteId *string `json:"invite_id"`
|
||||
AllowOpenInvite *bool `json:"allow_open_invite"`
|
||||
GroupConstrained *bool `json:"group_constrained"`
|
||||
}
|
||||
@@ -153,6 +152,10 @@ func (o *Team) IsValid() *AppError {
|
||||
return NewAppError("Team.IsValid", "model.team.is_valid.description.app_error", nil, "id="+o.Id, http.StatusBadRequest)
|
||||
}
|
||||
|
||||
if len(o.InviteId) == 0 {
|
||||
return NewAppError("Team.IsValid", "model.team.is_valid.invite_id.app_error", nil, "id="+o.Id, http.StatusBadRequest)
|
||||
}
|
||||
|
||||
if IsReservedTeamName(o.Name) {
|
||||
return NewAppError("Team.IsValid", "model.team.is_valid.reserved.app_error", nil, "id="+o.Id, http.StatusBadRequest)
|
||||
}
|
||||
@@ -268,10 +271,6 @@ func (t *Team) Patch(patch *TeamPatch) {
|
||||
t.AllowedDomains = *patch.AllowedDomains
|
||||
}
|
||||
|
||||
if patch.InviteId != nil {
|
||||
t.InviteId = *patch.InviteId
|
||||
}
|
||||
|
||||
if patch.AllowOpenInvite != nil {
|
||||
t.AllowOpenInvite = *patch.AllowOpenInvite
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user