Skip to content

Commit

Permalink
Removed condition in multisite_user and Changed first condition (#406)
Browse files Browse the repository at this point in the history
  • Loading branch information
daniyalfarman authored Aug 15, 2023
1 parent 664340c commit ba357fa
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions openedx/core/djangoapps/user_authn/views/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,16 +521,12 @@ def _is_user_exist_in_multisite(self, request, data):
email = data.get('email')
username = data.get('username')
errors = {}
if User.objects.filter(email=email, username=username).exists():
user = User.objects.get(email=email, username=username)
if User.objects.filter(email=email).exists():
user = User.objects.get(email=email)
edly_access_user = create_edly_access_role(request, user)
create_learner_link_with_permission_groups(edly_access_user)
return self._create_response(request, {}, status_code=200)

elif User.objects.filter(email=email).exists():
errors["email"] = [{"user_message": "Email {} already exists".format(email)}]
return self._create_response(request, errors, status_code=400)

elif User.objects.filter(username=username).exists():
errors["username"] = [{"user_message": "Username {} already exists.".format(username)}]
return self._create_response(request, errors, status_code=400)
Expand Down

0 comments on commit ba357fa

Please sign in to comment.