Skip to content
Browse files

Don't hide announcements after the last hidden one.

Previously, the "hide all announcements before N" cookie was setting N to "the
time the user clicked hide".  Now it's setting N to "the creation date of the
announcement the user is hiding".

For https://unisubs.sifterapp.com/projects/12298/issues/700003/comments
  • Loading branch information...
1 parent efcdb81 commit 6039284a7efdde08bbe5be4a420998e1ae34b65e @sjl sjl committed
Showing with 5 additions and 2 deletions.
  1. +5 −2 apps/auth/templatetags/announcement_tags.py
View
7 apps/auth/templatetags/announcement_tags.py
@@ -33,8 +33,11 @@ def announcement(context):
except (ValueError, TypeError, AttributeError):
hidden_date = None
+ ann = Announcement.last(hidden_date)
+ date = ann.created.strftime(Announcement.cookie_date_format) if ann else None
+
return {
- 'obj': Announcement.last(hidden_date),
+ 'obj': ann,
'cookie_name': Announcement.hide_cookie_name,
- 'date': datetime.now().strftime(Announcement.cookie_date_format)
+ 'date': date,
}

0 comments on commit 6039284

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