User: remove empty email / username check from update in service (#77347)
User: remove empty email / username check from update in service
This commit is contained in:
@@ -224,15 +224,6 @@ func (s *Service) GetByEmail(ctx context.Context, query *user.GetUserByEmailQuer
|
||||
}
|
||||
|
||||
func (s *Service) Update(ctx context.Context, cmd *user.UpdateUserCommand) error {
|
||||
if len(cmd.Login) == 0 {
|
||||
cmd.Login = cmd.Email
|
||||
}
|
||||
|
||||
// if login is still empty both email and login field is missing
|
||||
if len(cmd.Login) == 0 {
|
||||
return user.ErrEmptyUsernameAndEmail.Errorf("user cannot be created with empty username and email")
|
||||
}
|
||||
|
||||
if s.cfg.CaseInsensitiveLogin {
|
||||
cmd.Login = strings.ToLower(cmd.Login)
|
||||
cmd.Email = strings.ToLower(cmd.Email)
|
||||
|
||||
Reference in New Issue
Block a user