Skip to content
Snippets Groups Projects
Commit 4cce79e0 authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

TMSS-648: removed weird excaped line ending handling. Added prerequisite for...

TMSS-648: removed weird excaped line ending handling. Added prerequisite for is_feedback_complete, the number of output dataproducts needs to be > 0
parent 0b057f46
No related branches found
No related tags found
1 merge request!363Resolve TMSS-648
......@@ -236,8 +236,9 @@ class Subtask(BasicCommon):
@property
def is_feedback_complete(self) -> bool:
'''returns True if the feedback for all output dataproducts is filled in for a non-"empty"-template'''
return self.output_dataproducts.filter(feedback_template__isnull=False).exclude(feedback_template__name="empty").count() == self.output_dataproducts.count()
'''returns True if the feedback for all (>0) output dataproducts is filled in for a non-"empty"-template'''
nr_of_output_dataproducts = self.output_dataproducts.count()
return nr_of_output_dataproducts > 0 and self.output_dataproducts.filter(feedback_template__isnull=False).exclude(feedback_template__name="empty").count() == nr_of_output_dataproducts
@property
def progress(self) -> float:
......@@ -291,9 +292,6 @@ class Subtask(BasicCommon):
if self.start_time is None:
raise SubtaskSchedulingException("Cannot schedule subtask id=%s when start time is 'None'." % (self.pk, ))
if self.raw_feedback and '\\n' in self.raw_feedback:
self.raw_feedback = self.raw_feedback.replace('\\n', '\n')
super().save(force_insert, force_update, using, update_fields)
# log if either state update or new entry:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment