Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit 6039284a7efdde08bbe5be4a420998e1ae34b65e 1 parent efcdb81
@sjl sjl authored
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,
}
Please sign in to comment.
Something went wrong with that request. Please try again.