gtsocial-umbx

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 281f712477cbb5ba51c065ba7889caa78242117b
parent 34716d7d7d704c3f669cc92aa535ba19297c134d
Author: tobi <31960611+tsmethurst@users.noreply.github.com>
Date:   Fri,  2 Dec 2022 17:41:10 +0100

[bugfix] Fix `admin account confirm` on pre-confirmed account setting email address to empty string (#1203)


Diffstat:
Mcmd/gotosocial/action/admin/account/account.go | 5++---
Minternal/db/bundb/admin.go | 1-
2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/cmd/gotosocial/action/admin/account/account.go b/cmd/gotosocial/action/admin/account/account.go @@ -111,13 +111,12 @@ var Confirm action.GTSAction = func(ctx context.Context) error { return err } - updatingColumns := []string{"approved", "email", "confirmed_at", "updated_at"} + updatingColumns := []string{"approved", "email", "confirmed_at"} approved := true u.Approved = &approved u.Email = u.UnconfirmedEmail u.ConfirmedAt = time.Now() - u.UpdatedAt = time.Now() - if err := dbConn.UpdateByID(ctx, u, u.ID, updatingColumns...); err != nil { + if err := dbConn.UpdateUser(ctx, u, updatingColumns...); err != nil { return err } diff --git a/internal/db/bundb/admin.go b/internal/db/bundb/admin.go @@ -174,7 +174,6 @@ func (a *adminDB) NewSignup(ctx context.Context, username string, reason string, if emailVerified { u.ConfirmedAt = time.Now() u.Email = email - u.UnconfirmedEmail = "" } if admin {