From: Charles Connell Date: Sat, 10 May 2014 23:11:51 +0000 (-0400) Subject: Fix a bug with tweets X-Git-Tag: release-20150131~96 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=49f24442582a8cbe662d1191c4fcfdedb5f24343;p=oweals%2Fkarmaworld.git Fix a bug with tweets --- diff --git a/karmaworld/apps/notes/tasks.py b/karmaworld/apps/notes/tasks.py index fe5534b..946ebaa 100644 --- a/karmaworld/apps/notes/tasks.py +++ b/karmaworld/apps/notes/tasks.py @@ -58,8 +58,13 @@ def tweet_string(note): # 57 characters short_note = note.name[:57] - if note.course.school.hashtag: - return short_url + " #" + note.course.school.hashtag + " " + \ + if note.course.school: + school = note.course.school + else: + school = note.course.department.school + + if school.hashtag: + return short_url + " #" + school.hashtag + " " + \ short_course + ": " + \ short_note else: