Permalink
Browse files

changed notification template naming: plain.txt -> full.txt; teaser.h…

…tml -> notice.html

git-svn-id: http://django-notification.googlecode.com/svn/trunk@110 590c3fc9-4838-0410-bb95-17a0c9b37ca9
  • Loading branch information...
1 parent 1245413 commit 52866b3171edc1533555b63e32734cf32a515cdf @jtauber jtauber committed Oct 20, 2008
Showing with 6 additions and 7 deletions.
  1. +6 −7 notification/models.py
@@ -221,8 +221,7 @@ def get_formatted_messages(formats, label, context):
# conditionally turn off autoescaping for .txt extensions in format
if format.endswith(".txt"):
context.autoescape = False
- name = format.split(".")[0]
- format_templates[name] = render_to_string((
+ format_templates[format] = render_to_string((
'notification/%s/%s' % (label, format),
'notification/%s' % format), context_instance=context)
return format_templates
@@ -256,8 +255,8 @@ def send_now(users, label, extra_context=None, on_site=True):
formats = (
'short.txt',
- 'plain.txt',
- 'teaser.html',
+ 'full.txt',
+ 'notice.html',
'full.html',
) # TODO make formats configurable
@@ -288,14 +287,14 @@ def send_now(users, label, extra_context=None, on_site=True):
# Strip newlines from subject
subject = ''.join(render_to_string('notification/email_subject.txt', {
- 'message': messages['short'],
+ 'message': messages['short.txt'],
}, context).splitlines())
body = render_to_string('notification/email_body.txt', {
- 'message': messages['plain'],
+ 'message': messages['full.txt'],
}, context)
- notice = Notice.objects.create(user=user, message=messages['teaser'],
+ notice = Notice.objects.create(user=user, message=messages['notice.html'],
notice_type=notice_type, on_site=on_site)
if should_send(user, notice_type, "1") and user.email: # Email
recipients.append(user.email)

0 comments on commit 52866b3

Please sign in to comment.