You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2021/07/18 19:27:03 UTC

[airavata-django-portal] 03/04: authz_token should already exist on request in login signal

This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch staging
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git

commit a48122659ab6f844850b201b2e1df6912fa2b249
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Sun Jul 18 15:24:10 2021 -0400

    authz_token should already exist on request in login signal
---
 django_airavata/apps/auth/signals.py | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/django_airavata/apps/auth/signals.py b/django_airavata/apps/auth/signals.py
index dfc76cd..eb12e17 100644
--- a/django_airavata/apps/auth/signals.py
+++ b/django_airavata/apps/auth/signals.py
@@ -38,12 +38,11 @@ def initialize_user_profile(sender, request, user, **kwargs):
     # have an Airavata user profile (See IAMAdminServices.enableUser). The
     # following is necessary for users coming from federated login who don't
     # need to verify their email.
-    authz_token = utils.get_authz_token(request)
-    if authz_token is not None:
-        if not user_profile_client_pool.doesUserExist(authz_token,
+    if request.authz_token is not None:
+        if not user_profile_client_pool.doesUserExist(request.authz_token,
                                                       user.username,
                                                       settings.GATEWAY_ID):
-            user_profile_client_pool.initializeUserProfile(authz_token)
+            user_profile_client_pool.initializeUserProfile(request.authz_token)
             log.info("initialized user profile for {}".format(user.username))
             # Since user profile created, inform admins of new user
             utils.send_new_user_email(