fix: not changing rank for newly registered user when changing mail
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user