]> source.dussan.org Git - gitea.git/commitdiff
Remove unused commit (#14741)
authorLunny Xiao <xiaolunwen@gmail.com>
Sat, 20 Feb 2021 14:02:39 +0000 (22:02 +0800)
committerGitHub <noreply@github.com>
Sat, 20 Feb 2021 14:02:39 +0000 (15:02 +0100)
* Remove unused commit

* a small nit

Signed-off-by: a1012112796 <1012112796@qq.com>
Co-authored-by: a1012112796 <1012112796@qq.com>
models/migrations/v166.go

index 3d6cf4f57f54716ff7235aae9d5cbcff0edbe03f..1b6e68b5733ab534a91f94f92dd3e2a087060133 100644 (file)
@@ -106,10 +106,8 @@ func recalculateUserEmptyPWD(x *xorm.Engine) (err error) {
        }
 
        // delete salt and algo where password is empty
-       if _, err = sess.Where(builder.Eq{"passwd": ""}.And(builder.Neq{"salt": ""}.Or(builder.Neq{"passwd_hash_algo": ""}))).
-               Cols("salt", "passwd_hash_algo").Update(&User{}); err != nil {
-               return err
-       }
+       _, err = sess.Where(builder.Eq{"passwd": ""}.And(builder.Neq{"salt": ""}.Or(builder.Neq{"passwd_hash_algo": ""}))).
+               Cols("salt", "passwd_hash_algo").Update(&User{})
 
-       return sess.Commit()
+       return err
 }