From 49f24442582a8cbe662d1191c4fcfdedb5f24343 Mon Sep 17 00:00:00 2001 From: Charles Connell Date: Sat, 10 May 2014 19:11:51 -0400 Subject: [PATCH] Fix a bug with tweets --- karmaworld/apps/notes/tasks.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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: -- 2.25.1