mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-09 17:08:06 -06:00
[chore] reversion: use specific columns for updating user again (#1059)
This commit is contained in:
parent
8598dea98b
commit
940abc279c
4 changed files with 37 additions and 27 deletions
|
|
@ -151,8 +151,7 @@ var Promote action.GTSAction = func(ctx context.Context) error {
|
|||
|
||||
admin := true
|
||||
u.Admin = &admin
|
||||
u.UpdatedAt = time.Now()
|
||||
if err := dbConn.UpdateUser(ctx, u); err != nil {
|
||||
if err := dbConn.UpdateUser(ctx, u, "admin"); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -186,8 +185,7 @@ var Demote action.GTSAction = func(ctx context.Context) error {
|
|||
|
||||
admin := false
|
||||
u.Admin = &admin
|
||||
u.UpdatedAt = time.Now()
|
||||
if err := dbConn.UpdateUser(ctx, u); err != nil {
|
||||
if err := dbConn.UpdateUser(ctx, u, "admin"); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -221,8 +219,7 @@ var Disable action.GTSAction = func(ctx context.Context) error {
|
|||
|
||||
disabled := true
|
||||
u.Disabled = &disabled
|
||||
u.UpdatedAt = time.Now()
|
||||
if err := dbConn.UpdateUser(ctx, u); err != nil {
|
||||
if err := dbConn.UpdateUser(ctx, u, "disabled"); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
@ -268,8 +265,7 @@ var Password action.GTSAction = func(ctx context.Context) error {
|
|||
}
|
||||
|
||||
u.EncryptedPassword = string(pw)
|
||||
u.UpdatedAt = time.Now()
|
||||
if err := dbConn.UpdateUser(ctx, u); err != nil {
|
||||
if err := dbConn.UpdateUser(ctx, u, "encrypted_password"); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue