Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: sitescripts/notifications/web/notification.py

Issue 29327106: Issue 3048 - Mark inactive notifications instead of removing them (Closed)
Patch Set: Created Sept. 10, 2015, 11:25 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sitescripts/notifications/web/notification.py
===================================================================
--- a/sitescripts/notifications/web/notification.py
+++ b/sitescripts/notifications/web/notification.py
@@ -29,8 +29,6 @@
if x.count("/") == 1)
groups = []
for notification in notifications:
- if "variants" not in notification:
- continue
group_id = notification["id"]
if group_id in version_groups:
groups.append({"id": group_id, "variant": int(version_groups[group_id])})
@@ -104,6 +102,8 @@
version = params.get("lastVersion", [""])[0]
notifications = load_notifications()
groups = _determine_groups(version, notifications)
+ notifications = [x for x in notifications
+ if not ("inactive" in x and x["inactive"])]
Sebastian Noack 2015/09/10 13:29:20 How about |not x.get("inactive", False)| ?
Felix Dahlke 2015/09/11 07:04:43 Done.
if not groups:
groups = _assign_groups(notifications)
response = _create_response(notifications, groups)
« sitescripts/notifications/parser.py ('K') | « sitescripts/notifications/test/parser.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld