mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-17 11:49:29 +00:00
Sort events by startIn
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import re
|
import re
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from xml.dom import minidom
|
from xml.dom import minidom
|
||||||
|
from operator import itemgetter
|
||||||
|
|
||||||
from django.contrib.auth import login, logout, authenticate
|
from django.contrib.auth import login, logout, authenticate
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
@@ -187,6 +188,7 @@ class OpTimerHandler(BaseHandler):
|
|||||||
'endsIn':-1,
|
'endsIn':-1,
|
||||||
'forumLink': ''}]}
|
'forumLink': ''}]}
|
||||||
else:
|
else:
|
||||||
|
events.sort(key=itemgetter('startsIn'))
|
||||||
return {'ops': events, 'doc_time': cached_doc.time_retrieved, 'cache_until': cached_doc.cached_until, 'current_time': datetime.utcnow() }
|
return {'ops': events, 'doc_time': cached_doc.time_retrieved, 'cache_until': cached_doc.cached_until, 'current_time': datetime.utcnow() }
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user