This is an automated email from the ASF dual-hosted git repository.
linkinstar pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-answer.git
The following commit(s) were added to refs/heads/dev by this push:
new f9a93e2e fix: not changing rank for newly registered user when
changing mail
f9a93e2e is described below
commit f9a93e2efea182bcdc67abd635d9b081501ef06c
Author: hgaol <[email protected]>
AuthorDate: Wed Mar 13 10:09:49 2024 +0800
fix: not changing rank for newly registered user when changing mail
---
internal/service/user_service.go | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/internal/service/user_service.go b/internal/service/user_service.go
index c6d98fc2..bcac08ad 100644
--- a/internal/service/user_service.go
+++ b/internal/service/user_service.go
@@ -23,9 +23,10 @@ import (
"context"
"encoding/json"
"fmt"
+ "time"
+
"github.com/apache/incubator-answer/internal/base/constant"
"github.com/apache/incubator-answer/internal/service/user_notification_config"
- "time"
"github.com/apache/incubator-answer/internal/base/handler"
"github.com/apache/incubator-answer/internal/base/reason"
@@ -644,6 +645,12 @@ func (us *UserService) UserChangeEmailVerify(ctx
context.Context, content string
if err != nil {
return nil, err
}
+ // if email status is to be verified, active user as well
+ if userInfo.MailStatus == entity.EmailStatusToBeVerified {
+ if err = us.userActivity.UserActive(ctx, userInfo.ID); err !=
nil {
+ log.Error(err)
+ }
+ }
roleID, err := us.userRoleService.GetUserRole(ctx, userInfo.ID)
if err != nil {