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/06/14 20:09:08 UTC

[airavata-django-portal] 03/04: AIRAVATA-3833 Bug fixes

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

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

commit f08c213c42eec55a20d2895e5d30d653b68b13d3
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Mon Jun 14 16:08:22 2021 -0400

    AIRAVATA-3833 Bug fixes
---
 django_airavata/apps/auth/views.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/django_airavata/apps/auth/views.py b/django_airavata/apps/auth/views.py
index f005a67..1ef0259 100644
--- a/django_airavata/apps/auth/views.py
+++ b/django_airavata/apps/auth/views.py
@@ -2,7 +2,7 @@ import io
 import logging
 import time
 from datetime import datetime, timedelta, timezone
-from urllib.parse import quote, urlencode
+from urllib.parse import quote, urlencode, urlparse
 
 import requests
 from django.conf import settings
@@ -511,7 +511,7 @@ def _create_login_desktop_failed_response(request, idp_alias=None):
 @login_required
 def download_settings_local(request):
 
-    if not request.is_gateway_admin or not request.is_read_only_gateway_admin:
+    if not (request.is_gateway_admin or request.is_read_only_gateway_admin):
         raise PermissionDenied()
 
     if settings.DEBUG:
@@ -566,7 +566,8 @@ def get_client(access_token, clients_endpoint, client_id):
 
 def get_clients_endpoint():
     realm = settings.GATEWAY_ID
-    clients_endpoint = f"https://iamdev.scigap.org/auth/admin/realms/{realm}/clients"
+    parse_result = urlparse(settings.KEYCLOAK_AUTHORIZE_URL)
+    clients_endpoint = f"{parse_result.scheme}://{parse_result.netloc}/auth/admin/realms/{realm}/clients"
     return clients_endpoint