Skip to content

Commit

Permalink
Fix empty issue messages
Browse files Browse the repository at this point in the history
  • Loading branch information
klkvr committed Nov 15, 2023
1 parent d3de98a commit 284c83d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions anytask/issues/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down Expand Up @@ -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'<div class="issue-page-comment not-sanitize">' + value['comment'] + u'</div>'

if not self.is_status_auto_verification() and not self.is_status_accepted():
self.set_field_comment_update_status(author, sent)
return value

return False, value

def set_field_comment_update_status(self, author, sent):
if author == self.student and not self.is_status_need_info() and sent:
Expand Down
2 changes: 1 addition & 1 deletion anytask/users/templates/user_courses.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ <h5 class="card-title">
{% for year, courses_in_year in table %}
<div class="tab-pane fade {% if year == current_year or forloop.last and not table|has_item:current_year %}in active{% endif %}" id="{% if forloop.parentloop.first %}courses_{% else %}courses_archive_{% endif %}{{ forloop.counter }}" role="tabpanel">
<div class="card-block">
{% for table_id, course_statistics in courses_in_year.iteritems %}
{% for table_id, course_statistics in courses_in_year.items %}
<div class="card-table">
<table class="table table_courses">
<thead>
Expand Down

0 comments on commit 284c83d

Please sign in to comment.