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/10/06 13:41:31 UTC

[airavata-django-portal] 07/13: AIRAVATA-3468 Allow /media/ in completeness check middleware (gateway logo)

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

machristie pushed a commit to branch AIRAVATA-3319-handle-missing-name-and-email-attributes-from-cilo
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git

commit 530e1cbcc6fd6d21a9a9cf11039557cd22e284b6
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Wed Jul 7 13:55:59 2021 -0400

    AIRAVATA-3468 Allow /media/ in completeness check middleware (gateway logo)
---
 django_airavata/apps/auth/middleware.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/django_airavata/apps/auth/middleware.py b/django_airavata/apps/auth/middleware.py
index 7921405..78ec89c 100644
--- a/django_airavata/apps/auth/middleware.py
+++ b/django_airavata/apps/auth/middleware.py
@@ -84,9 +84,9 @@ def user_profile_completeness_check(get_response):
             return get_response(request)
 
         if (not request.user.user_profile.is_complete and
-                request.path != reverse('django_airavata_auth:user_profile') and
-                request.path != reverse('django_airavata_auth:logout') and
-                request.META['HTTP_ACCEPT'] != 'application/json'):
+            request.path != reverse('django_airavata_auth:user_profile') and
+            request.path != reverse('django_airavata_auth:logout') and
+                request.META['HTTP_ACCEPT'] != 'application/json') and not request.path.startswith("/media/"):
             return redirect('django_airavata_auth:user_profile')
         else:
             return get_response(request)