fixes + db changes (#204)

* fixes + db changes

* make duration more lenient
This commit is contained in:
tobi 2021-09-10 14:36:10 +02:00 committed by GitHub
commit e681aac589
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 401 additions and 78 deletions

View file

@ -107,7 +107,6 @@ func (m *Module) AccountUpdateCredentialsPATCHHandler(c *gin.Context) {
}
l.Tracef("retrieved account %+v", authed.Account.ID)
l.Debugf("parsing request form %s", c.Request.Form)
form := &model.UpdateCredentialsRequest{}
if err := c.ShouldBind(&form); err != nil || form == nil {
l.Debugf("could not parse form from request: %s", err)
@ -115,6 +114,8 @@ func (m *Module) AccountUpdateCredentialsPATCHHandler(c *gin.Context) {
return
}
l.Debugf("parsed request form %+v", form)
// if everything on the form is nil, then nothing has been set and we shouldn't continue
if form.Discoverable == nil && form.Bot == nil && form.DisplayName == nil && form.Note == nil && form.Avatar == nil && form.Header == nil && form.Locked == nil && form.Source == nil && form.FieldsAttributes == nil {
l.Debugf("could not parse form from request")