airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From machris...@apache.org
Subject [airavata-django-portal] branch master updated: AIRAVATA-3029 Handle missing app interface, app output
Date Mon, 01 Jul 2019 19:13:22 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
     new 5be3f3e  AIRAVATA-3029 Handle missing app interface, app output
5be3f3e is described below

commit 5be3f3eeb6c42fabd0aca6f92821a5629ac1b3cc
Author: Marcus Christie <machristie@apache.org>
AuthorDate: Mon Jul 1 15:13:01 2019 -0400

    AIRAVATA-3029 Handle missing app interface, app output
---
 django_airavata/apps/api/output_views.py | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/django_airavata/apps/api/output_views.py b/django_airavata/apps/api/output_views.py
index 9ffbb05..ea8fc70 100644
--- a/django_airavata/apps/api/output_views.py
+++ b/django_airavata/apps/api/output_views.py
@@ -25,7 +25,7 @@ DEFAULT_VIEW_PROVIDERS = {
 }
 
 
-def get_output_views(request, experiment, application_interface):
+def get_output_views(request, experiment, application_interface=None):
     output_views = {}
     for output in experiment.experimentOutputs:
         output_views[output.name] = []
@@ -75,11 +75,12 @@ def _get_output_view_providers(experiment_output, application_interface):
     if 'default' not in output_view_providers:
         output_view_providers.insert(0, 'default')
     # Add in any output view providers defined on the application interface
-    app_output_view_providers = _get_application_output_view_providers(
-        application_interface, experiment_output.name)
-    for view_provider in app_output_view_providers:
-        if view_provider not in output_view_providers:
-            output_view_providers.append(view_provider)
+    if application_interface is not None:
+        app_output_view_providers = _get_application_output_view_providers(
+            application_interface, experiment_output.name)
+        for view_provider in app_output_view_providers:
+            if view_provider not in output_view_providers:
+                output_view_providers.append(view_provider)
     return output_view_providers
 
 
@@ -89,6 +90,8 @@ def _get_application_output_view_providers(application_interface, output_name):
                   if o.name == output_name]
     if len(app_output) == 1:
         app_output = app_output[0]
+    else:
+        return []
     if app_output.metaData:
         try:
             output_metadata = json.loads(app_output.metaData)


Mime
View raw message