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

Unified Diff: sitescripts/notifications/parser.py

Issue 29322888: Issue 2707 - Remove start/end from notifications (Closed)
Patch Set: Refactoring Created July 29, 2015, 2:29 p.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
« no previous file with comments | « no previous file | sitescripts/notifications/test/parser.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sitescripts/notifications/parser.py
===================================================================
--- a/sitescripts/notifications/parser.py
+++ b/sitescripts/notifications/parser.py
@@ -122,9 +122,11 @@
if "inactive" in notification:
continue
current_time = datetime.datetime.now()
- if "start" in notification and current_time < notification["start"]:
+ start = notification.pop("start", None)
+ if start is not None and current_time < start:
continue
- if "end" in notification and current_time > notification["end"]:
+ end = notification.pop("end", None)
+ if end is not None and current_time > end:
continue
notifications.append(notification)
except:
« no previous file with comments | « no previous file | sitescripts/notifications/test/parser.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld