Skip to content
Browse files

Wrap alias-based features in a check for the DIRECTORY_JSON setting

  • Loading branch information...
1 parent 46ea264 commit b5e007481cf81cc0f3f68cc804f441a3dca76009 @meldra committed
Showing with 13 additions and 9 deletions.
  1. +13 −9 brain/views.py
View
22 brain/views.py
@@ -282,16 +282,20 @@ def singleday(year, month, day):
for mboxmail in mboxlist:
avatar_url = libravatar_url(email = mboxmail['From'], size = 150)
- try:
- tagstring = gettags(mboxmail['From'], mboxmail['Body'])
- tagstring = ' | '.join(tagstring)
- except:
- tagstring = ''
+ if settings.DIRECTORY_JSON:
- try:
- others = getothers(mboxmail['Subject'], mboxmail['From'])
- except:
- others = ''
+ try:
+ tagstring = gettags(mboxmail['From'], mboxmail['Body'])
+ tagstring = ' | '.join(tagstring)
+ except:
+ tagstring = ''
+
+ try:
+ others = getothers(mboxmail['Subject'], mboxmail['From'])
+ except:
+ others = ''
+ else:
+ tagstring = others = ''
if len(others) > 0:
others = 'Possible mentions:<br/>%s' % others

0 comments on commit b5e0074

Please sign in to comment.
Something went wrong with that request. Please try again.