MM-56881 Validate and ensure valid CustomStatus is stored (#26287)
* don't allow invalid CustomStatus * allow empty emoji in custom status * lint fix * add english translation * update for review comments. * fix bad fix --------- Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
5740b43922
Коммит
30454f241d
@@ -35,10 +35,6 @@ type CustomStatus struct {
|
||||
}
|
||||
|
||||
func (cs *CustomStatus) PreSave() {
|
||||
if cs.Emoji == "" {
|
||||
cs.Emoji = DefaultCustomStatusEmoji
|
||||
}
|
||||
|
||||
if cs.Duration == "" && !cs.ExpiresAt.Before(time.Now()) {
|
||||
cs.Duration = "date_and_time"
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user