@@ -206,13 +206,13 @@ func (u *User) SetLastLogin() {
206206// UpdateUserDiffViewStyle updates the users diff view style
207207func UpdateUserDiffViewStyle (u * User , style string ) error {
208208 u .DiffViewStyle = style
209- return UpdateUserCols (db .DefaultContext , u , false , "diff_view_style" )
209+ return UpdateUserCols (db .DefaultContext , u , "diff_view_style" )
210210}
211211
212212// UpdateUserTheme updates a users' theme irrespective of the site wide theme
213213func UpdateUserTheme (u * User , themeName string ) error {
214214 u .Theme = themeName
215- return UpdateUserCols (db .DefaultContext , u , false , "theme" )
215+ return UpdateUserCols (db .DefaultContext , u , "theme" )
216216}
217217
218218// GetEmail returns an noreply email, if the user has set to keep his
@@ -502,7 +502,7 @@ func (u *User) EmailNotifications() string {
502502// SetEmailNotifications sets the user's email notification preference
503503func SetEmailNotifications (u * User , set string ) error {
504504 u .EmailNotificationsPreference = set
505- if err := UpdateUserCols (db .DefaultContext , u , false , "email_notifications_preference" ); err != nil {
505+ if err := UpdateUserCols (db .DefaultContext , u , "email_notifications_preference" ); err != nil {
506506 log .Error ("SetEmailNotifications: %v" , err )
507507 return err
508508 }
@@ -908,13 +908,18 @@ func UpdateUser(u *User, emailChanged bool) error {
908908}
909909
910910// UpdateUserCols update user according special columns
911- func UpdateUserCols (ctx context.Context , u * User , force bool , cols ... string ) error {
912- return updateUserCols (db .GetEngine (ctx ), u , force , cols ... )
911+ func UpdateUserCols (ctx context.Context , u * User , cols ... string ) error {
912+ return updateUserCols (db .GetEngine (ctx ), u , false , cols ... )
913+ }
914+
915+ // UpdateForceUserCols force update user according special columns.
916+ func UpdateForceUserCols (ctx context.Context , u * User , cols ... string ) error {
917+ return updateUserCols (db .GetEngine (ctx ), u , true , cols ... )
913918}
914919
915920// UpdateUserColsEngine update user according special columns
916- func UpdateUserColsEngine (e db.Engine , u * User , force bool , cols ... string ) error {
917- return updateUserCols (e , u , force , cols ... )
921+ func UpdateUserColsEngine (e db.Engine , u * User , cols ... string ) error {
922+ return updateUserCols (e , u , false , cols ... )
918923}
919924
920925func updateUserCols (e db.Engine , u * User , force bool , cols ... string ) error {
0 commit comments