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 2018/11/20 17:18:45 UTC

[airavata-django-portal] branch master updated: AIRAVATA-2953 Fix saving experiment with input metadata

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 4601675  AIRAVATA-2953 Fix saving experiment with input metadata
4601675 is described below

commit 460167575a44e2627b89039260be3329a06380af
Author: Marcus Christie <ma...@iu.edu>
AuthorDate: Tue Nov 20 12:18:29 2018 -0500

    AIRAVATA-2953 Fix saving experiment with input metadata
---
 django_airavata/apps/api/serializers.py | 9 ++++++---
 django_airavata/apps/api/views.py       | 4 +++-
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/django_airavata/apps/api/serializers.py b/django_airavata/apps/api/serializers.py
index d1bf697..90225c2 100644
--- a/django_airavata/apps/api/serializers.py
+++ b/django_airavata/apps/api/serializers.py
@@ -235,7 +235,7 @@ class ProjectSerializer(
 
     class Meta:
         required = ('name',)
-        read_only = ('projectID', 'owner', 'gatewayId')
+        read_only = ('owner', 'gatewayId')
 
     url = FullyEncodedHyperlinkedIdentityField(
         view_name='django_airavata_api:project-detail',
@@ -383,7 +383,7 @@ class ExperimentSerializer(
 
     class Meta:
         required = ('projectId', 'experimentType', 'experimentName')
-        read_only = ('experimentId', 'userName', 'gatewayId')
+        read_only = ('userName', 'gatewayId')
 
     url = FullyEncodedHyperlinkedIdentityField(
         view_name='django_airavata_api:experiment-detail',
@@ -405,8 +405,11 @@ class ExperimentSerializer(
         view_name='django_airavata_api:shared-entity-detail',
         lookup_field='experimentId',
         lookup_url_kwarg='entity_id')
+    experimentInputs = serializers.ListField(
+        child=InputDataObjectTypeSerializer(),
+        allow_null=True)
     creationTime = UTCPosixTimestampDateTimeField(allow_null=True)
-    experimentStatus = ExperimentStatusSerializer(many=True, read_only=True)
+    experimentStatus = ExperimentStatusSerializer(many=True, allow_null=True)
 
 
 class DataReplicaLocationSerializer(
diff --git a/django_airavata/apps/api/views.py b/django_airavata/apps/api/views.py
index 16c2ed0..92aeb06 100644
--- a/django_airavata/apps/api/views.py
+++ b/django_airavata/apps/api/views.py
@@ -173,7 +173,9 @@ class ExperimentViewSet(APIBackedViewSet):
         experiment.experimentId = experiment_id
 
     def perform_update(self, serializer):
-        experiment = serializer.save()
+        experiment = serializer.save(
+            gatewayId=self.gateway_id,
+            userName=self.username)
         self.request.airavata_client.updateExperiment(
             self.authz_token, experiment.experimentId, experiment)