SystemStore migration to return plain errors (#14835)

* SystemStore migration to return plain errors

* Fix nilness

* Fix translations

* Fix merge

* Fix layers

* Fix merge errors

* Lint: remove unnecessary use of sprint

* Fix merge errors

* Fix i18n

Co-authored-by: Agniva De Sarker <agnivade@yahoo.co.in>
Этот коммит содержится в:
Rodrigo Villablanca
2020-08-13 11:02:57 -04:00
коммит произвёл GitHub
родитель e8d431ee7c
Коммит 20e44399c7
18 изменённых файлов: 252 добавлений и 173 удалений

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

@@ -55,17 +55,17 @@ func (a *App) ResetPermissionsSystem() *model.AppError {
// Remove the "System" table entry that marks the advanced permissions migration as done.
if _, err := a.Srv().Store.System().PermanentDeleteByName(ADVANCED_PERMISSIONS_MIGRATION_KEY); err != nil {
return err
return model.NewAppError("ResetPermissionSystem", "app.system.permanent_delete_by_name.app_error", nil, err.Error(), http.StatusInternalServerError)
}
// Remove the "System" table entry that marks the emoji permissions migration as done.
if _, err := a.Srv().Store.System().PermanentDeleteByName(EMOJIS_PERMISSIONS_MIGRATION_KEY); err != nil {
return err
return model.NewAppError("ResetPermissionSystem", "app.system.permanent_delete_by_name.app_error", nil, err.Error(), http.StatusInternalServerError)
}
// Remove the "System" table entry that marks the guest roles permissions migration as done.
if _, err := a.Srv().Store.System().PermanentDeleteByName(GUEST_ROLES_CREATION_MIGRATION_KEY); err != nil {
return err
return model.NewAppError("ResetPermissionSystem", "app.system.permanent_delete_by_name.app_error", nil, err.Error(), http.StatusInternalServerError)
}
// Now that the permissions system has been reset, re-run the migration to reinitialise it.