Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

BACKWARD INCOMPATIBLE: renamed Notice.user to Notice.recipient and ch…

…anged its context variable to match

This change is being made to clarify the purpose of the User FK on Notice.
  • Loading branch information...
commit 5202196d107e61f230d0c8200ee1c2b4fda23aed 1 parent 91d9a2f
@brosner brosner authored
Showing with 11 additions and 3 deletions.
  1. +8 −0 CHANGELOG
  2. +3 −3 notification/models.py
View
8 CHANGELOG
@@ -1,3 +1,11 @@
+BI = backward incompatible change
+
+0.2.0
+-----
+
+ * BI: renamed Notice.user to Notice.recipient
+ * BI: renamed {{ user }} context variable in notification templates to {{ recipient }}
+
0.1.5
-----
View
6 notification/models.py
@@ -123,7 +123,7 @@ def unseen_count_for(self, user, **kwargs):
class Notice(models.Model):
- user = models.ForeignKey(User, verbose_name=_('user'))
+ recipient = models.ForeignKey(User, verbose_name=_('recipient'))
message = models.TextField(_('message'))
notice_type = models.ForeignKey(NoticeType, verbose_name=_('notice type'))
added = models.DateTimeField(_('added'), default=datetime.datetime.now)
@@ -282,7 +282,7 @@ def send_now(users, label, extra_context=None, on_site=True):
# update context with user specific translations
context = Context({
- "user": user,
+ "recipient": user,
"notice": ugettext(notice_type.display),
"notices_url": notices_url,
"current_site": current_site,
@@ -301,7 +301,7 @@ def send_now(users, label, extra_context=None, on_site=True):
'message': messages['full.txt'],
}, context)
- notice = Notice.objects.create(user=user, message=messages['notice.html'],
+ notice = Notice.objects.create(recipient=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)
Please sign in to comment.
Something went wrong with that request. Please try again.