diff --git a/i18n/en.json b/i18n/en.json index 478dad9c64..073364f092 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -6727,12 +6727,12 @@ "translation": "group syncable was already deleted" }, { - "id": "store.sql_group.no_rows", - "translation": "no matching group found" + "id": "store.sql_group.more_than_one_row_changed", + "translation": "More than one row changed." }, { - "id": "store.sql_group.no_rows_changed", - "translation": "no rows changed" + "id": "store.sql_group.no_rows", + "translation": "no matching group found" }, { "id": "store.sql_group.permanent_delete_members_by_user.app_error", diff --git a/store/sqlstore/group_store.go b/store/sqlstore/group_store.go index 6271b35587..9d97b9049d 100644 --- a/store/sqlstore/group_store.go +++ b/store/sqlstore/group_store.go @@ -232,8 +232,8 @@ func (s *SqlGroupStore) Update(group *model.Group) (*model.Group, *model.AppErro } return nil, model.NewAppError("SqlGroupStore.GroupUpdate", "store.update_error", nil, err.Error(), http.StatusInternalServerError) } - if rowsChanged != 1 { - return nil, model.NewAppError("SqlGroupStore.GroupUpdate", "store.sql_group.no_rows_changed", nil, "", http.StatusInternalServerError) + if rowsChanged > 1 { + return nil, model.NewAppError("SqlGroupStore.GroupUpdate", "store.sql_group.more_than_one_row_changed", nil, "", http.StatusInternalServerError) } return group, nil @@ -427,8 +427,8 @@ func (s *SqlGroupStore) UpsertMember(groupID string, userID string) (*model.Grou if rowsChanged, err = s.GetMaster().Update(member); err != nil { return nil, model.NewAppError("SqlGroupStore.GroupCreateOrRestoreMember", "store.update_error", nil, "group_id="+member.GroupId+", user_id="+member.UserId+", "+err.Error(), http.StatusInternalServerError) } - if rowsChanged != 1 { - return nil, model.NewAppError("SqlGroupStore.GroupCreateOrRestoreMember", "store.sql_group.no_rows_changed", nil, "", http.StatusInternalServerError) + if rowsChanged > 1 { + return nil, model.NewAppError("SqlGroupStore.GroupCreateOrRestoreMember", "store.sql_group.more_than_one_row_changed", nil, "", http.StatusInternalServerError) } }