Address another classic case of `var err error` and then trying to assign a `*model.AppError`. We really need to switch to passing `error` everywhere.
Этот коммит содержится в:
Jesse Hallam
2019-08-01 12:39:46 -03:00
коммит произвёл GitHub
родитель 89a79e2e9f
Коммит 11472e417c
2 изменённых файлов: 30 добавлений и 2 удалений

Просмотреть файл

@@ -99,8 +99,8 @@ func (m *Mfa) Activate(user *model.User, token string) *model.AppError {
return model.NewAppError("Activate", "mfa.activate.bad_token.app_error", nil, "", http.StatusUnauthorized)
}
if err = m.Store.User().UpdateMfaActive(user.Id, true); err != nil {
return model.NewAppError("Activate", "mfa.activate.save_active.app_error", nil, err.Error(), http.StatusInternalServerError)
if appErr := m.Store.User().UpdateMfaActive(user.Id, true); appErr != nil {
return model.NewAppError("Activate", "mfa.activate.save_active.app_error", nil, appErr.Error(), http.StatusInternalServerError)
}
return nil