From: Diane Trout Date: Thu, 2 Jun 2016 20:44:27 +0000 (-0700) Subject: Save new object before attaching to a collection X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=htsworkflow.git;a=commitdiff_plain;h=4ae3d92c9ff1767502f338c53ed409af13c99c00 Save new object before attaching to a collection Django tests were throwing warning about the newfile object not being saved when I added it to the datafile_set collection. --- diff --git a/experiments/models.py b/experiments/models.py index 4a42caa..b7fc5b8 100644 --- a/experiments/models.py +++ b/experiments/models.py @@ -351,6 +351,7 @@ class SequencingRun(models.Model): lane_number=lane_number) newfile.library = lane.library + newfile.save() self.datafile_set.add(newfile) self.last_update_time = timezone.now()