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/25 19:59:36 UTC

[airavata-django-portal] 03/10: AIRAVATA-3420 Use get_lazy_download_url to get URL that redirects to actual download URL

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 0afbc044310b391f6f51f3cc5682da2c8e6af94c
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Mon Apr 26 15:56:03 2021 -0400

    AIRAVATA-3420 Use get_lazy_download_url to get URL that redirects to actual download URL
---
 django_airavata/apps/api/serializers.py | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/django_airavata/apps/api/serializers.py b/django_airavata/apps/api/serializers.py
index 709f36a..159343f 100644
--- a/django_airavata/apps/api/serializers.py
+++ b/django_airavata/apps/api/serializers.py
@@ -2,7 +2,7 @@ import copy
 import datetime
 import json
 import logging
-from urllib.parse import quote, urlencode
+from urllib.parse import quote
 
 from airavata.model.appcatalog.appdeployment.ttypes import (
     ApplicationDeploymentDescription,
@@ -58,7 +58,6 @@ from airavata.model.workspace.ttypes import (
 )
 from airavata_django_portal_sdk import user_storage
 from django.conf import settings
-from django.urls import reverse
 from rest_framework import serializers
 
 from . import models, thrift_utils
@@ -468,8 +467,8 @@ class DataProductSerializer(
     def get_downloadURL(self, data_product):
         """Getter for downloadURL field."""
         request = self.context['request']
-        if hasattr(user_storage, 'get_download_url'):
-            return user_storage.get_download_url(request, data_product)
+        if hasattr(user_storage, 'get_lazy_download_url'):
+            return user_storage.get_lazy_download_url(request, data_product)
         return None
 
     def get_isInputFileUpload(self, data_product):
@@ -861,8 +860,8 @@ class UserStorageFileSerializer(serializers.Serializer):
     def get_downloadURL(self, file):
         """Getter for downloadURL field."""
         request = self.context['request']
-        if hasattr(user_storage, 'get_download_url'):
-            return user_storage.get_download_url(request, data_product_uri=file['data-product-uri'])
+        if hasattr(user_storage, 'get_lazy_download_url'):
+            return user_storage.get_lazy_download_url(request, data_product_uri=file['data-product-uri'])
 
 
 class UserStorageDirectorySerializer(serializers.Serializer):