diff --git a/anytask/issues/models.py b/anytask/issues/models.py index ac4b27590..f09565fd4 100644 --- a/anytask/issues/models.py +++ b/anytask/issues/models.py @@ -303,7 +303,7 @@ def set_field(self, field, value, author=None, from_contest=False): elif name == 'costudents_names': delete_event, value = self.set_field_costudents_names(value) elif name == 'comment': - value = self.set_field_comment(author, course, event, value) + delete_event, value = self.set_field_comment(author, course, event, value) elif name == 'status': delete_event, value = self.set_field_status(value) elif name == 'mark': @@ -389,17 +389,17 @@ def set_field_comment(self, author, course, event, value): if self.task.rb_integrated \ and (course.send_rb_and_contest_together or not self.task.contest_integrated): self.set_field_comment_rb_integrated(course, event, file, value) - + if not value['files'] and not value['comment']: - event.delete() - return + return True, None # Do not include empty comments else: self.update_time = timezone.now() value = u'