[MM-29731] Fix panic in saveUserTermsOfService (#16044)
* Fix panic in saveUserTermsOfService * Remove unneeded initialization
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
91bb7d3b11
Коммит
e5e2dbdf1a
12
api4/user.go
12
api4/user.go
@@ -2423,8 +2423,16 @@ func saveUserTermsOfService(c *Context, w http.ResponseWriter, r *http.Request)
|
||||
props := model.StringInterfaceFromJson(r.Body)
|
||||
|
||||
userId := c.App.Session().UserId
|
||||
termsOfServiceId := props["termsOfServiceId"].(string)
|
||||
accepted := props["accepted"].(bool)
|
||||
termsOfServiceId, ok := props["termsOfServiceId"].(string)
|
||||
if !ok {
|
||||
c.SetInvalidParam("termsOfServiceId")
|
||||
return
|
||||
}
|
||||
accepted, ok := props["accepted"].(bool)
|
||||
if !ok {
|
||||
c.SetInvalidParam("accepted")
|
||||
return
|
||||
}
|
||||
|
||||
auditRec := c.MakeAuditRecord("saveUserTermsOfService", audit.Fail)
|
||||
defer c.LogAuditRec(auditRec)
|
||||
|
||||
Ссылка в новой задаче
Block a user