From ba357fa41668cce97a8694c369f87ca4bc328ea3 Mon Sep 17 00:00:00 2001 From: Daniyal Farman <122009873+daniyalfarman@users.noreply.github.com> Date: Tue, 15 Aug 2023 16:22:03 +0500 Subject: [PATCH] Removed condition in multisite_user and Changed first condition (#406) --- openedx/core/djangoapps/user_authn/views/register.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/openedx/core/djangoapps/user_authn/views/register.py b/openedx/core/djangoapps/user_authn/views/register.py index 5840d925bb52..4cac68ab5a8f 100644 --- a/openedx/core/djangoapps/user_authn/views/register.py +++ b/openedx/core/djangoapps/user_authn/views/register.py @@ -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)