Allow serialization of hdas without 'creating job', though we should probably look into how/why this can ever happen. Seems like there's a bug hidden here somewhere, but this allows the existing functionality to work and pass tests.

This commit is contained in:
Dannon Baker
2015-09-17 10:52:06 -04:00
parent 3348715971
commit a7ca9586bb
2 changed files with 8 additions and 2 deletions
+7 -1
View File
@@ -327,7 +327,7 @@ class HDASerializer( # datasets._UnflattenedMetadataDatasetAssociationSerialize
'file_path' : self._remap_from( 'file_name' ),
'resubmitted' : lambda i, k, **c: self.hda_manager.has_been_resubmitted( i ),
'creating_job' : lambda i, k, **c: self.app.security.encode_id(i.creating_job.id),
'creating_job' : self.serialize_creating_job,
'display_apps' : self.serialize_display_apps,
'display_types' : self.serialize_old_display_applications,
@@ -433,6 +433,12 @@ class HDASerializer( # datasets._UnflattenedMetadataDatasetAssociationSerialize
}
return urls
def serialize_creating_job( self, hda, key, **context ):
if hda.creating_job:
self.app.security.encode_id(hda.creating_job.id),
else:
return None
class HDADeserializer( datasets.DatasetAssociationDeserializer,
taggable.TaggableDeserializerMixin,
+1 -1
View File
@@ -190,7 +190,7 @@ class JobController( BaseAPIController, UsesLibraryMixinItems ):
def build_for_rerun( self, trans, id, **kwd ):
"""
* GET /api/jobs/{job_id}/build_for_rerun
returns a tool input/param template preopoulated with this job's
returns a tool input/param template prepopulated with this job's
information, suitable for rerunning or rendering parameters of the
job.