# HG changeset patch # User Lennard de Rijk # Date 1237220841 0 # Node ID a8a5da24212c43473f7b8addb84d118954d52374 # Parent 4356a9201d20b76c70fb8bd73d5014a0d2e06bd0 Increased the length of the timebased link_id to handle more items at once. Patch by: Lennard de Rijk Reviewed by: to-be-reviewed diff -r 4356a9201d20 -r a8a5da24212c app/soc/logic/helper/notifications.py --- a/app/soc/logic/helper/notifications.py Mon Mar 16 15:33:27 2009 +0000 +++ b/app/soc/logic/helper/notifications.py Mon Mar 16 16:27:21 2009 +0000 @@ -150,12 +150,12 @@ message = loader.render_to_string(template, dictionary=message_properties) fields = { - 'from_user' : from_user, + 'from_user': from_user, 'subject': subject, - 'message' : message, - 'scope' : to_user, - 'link_id' :'t%i' % (time.time()), - 'scope_path' : to_user.link_id + 'message': message, + 'scope': to_user, + 'link_id': 't%i' %(int(time.time()*100)), + 'scope_path': to_user.link_id } key_name = model_logic.notification.logic.getKeyNameFromFields(fields) diff -r 4356a9201d20 -r a8a5da24212c app/soc/views/models/comment.py --- a/app/soc/views/models/comment.py Mon Mar 16 15:33:27 2009 +0000 +++ b/app/soc/views/models/comment.py Mon Mar 16 16:27:21 2009 +0000 @@ -130,7 +130,7 @@ if not entity: fields['author'] = user - fields['link_id'] = 't%i' % (time.time()) + fields['link_id'] = 't%i' %(int(time.time()*100)) else: fields['author'] = entity.author fields['link_id'] = entity.link_id diff -r 4356a9201d20 -r a8a5da24212c app/soc/views/models/notification.py --- a/app/soc/views/models/notification.py Mon Mar 16 15:33:27 2009 +0000 +++ b/app/soc/views/models/notification.py Mon Mar 16 16:27:21 2009 +0000 @@ -163,7 +163,7 @@ # get the current user current_user = user_logic.getForCurrentAccount() - fields['link_id'] = 't%i' % (time.time()) + fields['link_id'] = 't%i' %(int(time.time()*100)) fields['scope'] = fields['to_user'] fields['from_user'] = current_user fields['scope_path'] = fields['to_user'].link_id diff -r 4356a9201d20 -r a8a5da24212c app/soc/views/models/student_proposal.py --- a/app/soc/views/models/student_proposal.py Mon Mar 16 15:33:27 2009 +0000 +++ b/app/soc/views/models/student_proposal.py Mon Mar 16 16:27:21 2009 +0000 @@ -266,7 +266,7 @@ """ if not entity: - fields['link_id'] = 't%i' % (time.time()) + fields['link_id'] = 't%i' %(int(time.time()*100)) else: fields['link_id'] = entity.link_id @@ -910,7 +910,7 @@ from soc.logic.models.review import logic as review_logic # create the fields for the review entity - fields = {'link_id': 't%i' %(time.time()), + fields = {'link_id': 't%i' %(int(time.time()*100)), 'scope': entity, 'scope_path': entity.key().name(), 'author': user_logic.logic.getForCurrentAccount(),