Use time to index notifications
This commit is contained in:
1 parent
d16dd7c75d
commit
89e561c991
1 file changed
+2
-8
@@ -17,10 +17,7 @@ import time"""
|
|||||||
|
|
||||||
def make_key_value(self, data):
|
def make_key_value(self, data):
|
||||||
if data.get('_t') == 'notification':
|
if data.get('_t') == 'notification':
|
||||||
added = data.get('added', time.time())
|
return data.get('time'), None
|
||||||
data['added'] = added
|
|
||||||
|
|
||||||
return added, None
|
|
||||||
|
|
||||||
|
|
||||||
class NotificationUnreadIndex(TreeBasedIndex):
|
class NotificationUnreadIndex(TreeBasedIndex):
|
||||||
@@ -38,7 +35,4 @@ import time"""
|
|||||||
|
|
||||||
def make_key_value(self, data):
|
def make_key_value(self, data):
|
||||||
if data.get('_t') == 'notification' and not data.get('read'):
|
if data.get('_t') == 'notification' and not data.get('read'):
|
||||||
added = data.get('added', time.time())
|
return data.get('time'), None
|
||||||
data['added'] = added
|
|
||||||
|
|
||||||
return added, None
|
|
||||||
Reference in new issue
Block a user