Skip to content

Commit

Permalink
tack on a future flag
Browse files Browse the repository at this point in the history
  • Loading branch information
yeago committed Feb 6, 2014
1 parent 31d3dd5 commit 2c93aa6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions subscription/context_processors.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import datetime
from .stream import user_stream

def get_actstream(request):
Expand All @@ -7,9 +8,14 @@ def get_actstream(request):
If we have 'undelivered' items, we deliver them to the unacknowledged list
"""
stream = user_stream(request.user)
unacknowledged = False
if stream:
unacknowledged = request.user.get_profile(
).stream_pending_acknowledgements(stream[0][0])
return {'actstream': stream,
redux = []
for item in stream:
future = True
if item[0] > datetime.datetime.now():
future = True
redux.append((item, future))
return {'actstream': redux,
'actstream_unacknowledged': unacknowledged}

0 comments on commit 2c93aa6

Please sign in to comment.