From 90defb879b459affc964b35b7c52816cd3f664c1 Mon Sep 17 00:00:00 2001 From: RajatGupta02 Date: Sun, 16 Apr 2023 03:55:48 +0530 Subject: [PATCH] corrected assign user --- app/yearbook/middleware.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/yearbook/middleware.py b/app/yearbook/middleware.py index 44021d4..13e1dcd 100644 --- a/app/yearbook/middleware.py +++ b/app/yearbook/middleware.py @@ -139,14 +139,14 @@ def assign_user(self,request,user_payload): except: user = USER_MODEL.objects.create_user(email=user_payload['email'],username=user_payload['username']) - user.first_name = user_payload['firstname'] - user.last_name = user_payload['lastname'] - user.username = user_payload['username'] - user.save() - code = user_payload['username'][:2] - s = Student(name=user_payload['firstname'],department=code2dept[code]) - user.student = s - user.student.save() + user.first_name = user_payload['firstname'] + user.last_name = user_payload['lastname'] + user.username = user_payload['username'] + user.save() + code = user_payload['username'][:2] + s = Student(name=user_payload['firstname'],department=code2dept[code]) + user.student = s + user.student.save() login(request, user) def authorize_roles(self,request,user_payload): @@ -187,7 +187,7 @@ def redirect(self,request): return self.get_response(request) logging.info(f"request: {request}") logging.info("inside redirect function, line 189") - return redirect(AUTH_URL+f"/?{QUERY_PARAM}={re.sub(r'vm2-internal','devclub.in',request.build_absolute_uri())}") + return redirect(AUTH_URL+f"/?{QUERY_PARAM}={re.sub(r'vm2-internal','devclub.in',request.build_absolute_uri()).replace('http','https')}") def match_regex_list(key,regex_array):