diff options
-rw-r--r-- | askbot/management/commands/send_email_alerts.py | 25 | ||||
-rw-r--r-- | askbot/models/question.py | 2 |
2 files changed, 19 insertions, 8 deletions
diff --git a/askbot/management/commands/send_email_alerts.py b/askbot/management/commands/send_email_alerts.py index a9162079..dbaff93f 100644 --- a/askbot/management/commands/send_email_alerts.py +++ b/askbot/management/commands/send_email_alerts.py @@ -432,14 +432,23 @@ class Command(NoArgsCommand): question_count = len(q_list.keys()) - subject_line = ungettext( - '%(question_count)d update about %(topics)s', - '%(question_count)d updates about %(topics)s', - question_count - ) % { - 'question_count': question_count, - 'topics': tag_summary - } + if tag_summary: + subject_line = ungettext( + '%(question_count)d update about %(topics)s', + '%(question_count)d updates about %(topics)s', + question_count + ) % { + 'question_count': question_count, + 'topics': tag_summary + } + else: + subject_line = ungettext( + '%(question_count)d update', + '%(question_count)d updates', + question_count + ) % { + 'question_count': question_count, + } items_added = 0 items_unreported = 0 diff --git a/askbot/models/question.py b/askbot/models/question.py index 737a0876..97ce8999 100644 --- a/askbot/models/question.py +++ b/askbot/models/question.py @@ -122,6 +122,8 @@ class ThreadManager(BaseQuerySetManager): tag_list.sort(key=lambda t: tag_counts[t], reverse=True) #note that double quote placement is important here + if len(tag_list) == 0: + return '' if len(tag_list) == 1: last_topic = '"' elif len(tag_list) <= 5: |