Brown paper bag fix
Can't call .key() if there is no entity.
Patch by: Sverre Rabbelier
--- a/app/soc/views/models/base.py Sat Apr 11 23:04:29 2009 +0000
+++ b/app/soc/views/models/base.py Sun Apr 12 00:18:19 2009 +0000
@@ -453,7 +453,7 @@
"""
logic = params['logic']
- suffix = entity.key().id_or_name()
+ suffix = entity.key().id_or_name() if entity else None
# remove the params from the request, this is relevant only if
# someone bookmarked a POST page.
@@ -891,7 +891,7 @@
"""
logic = params['logic']
- suffix = entity.key().id_or_name()
+ suffix = entity.key().id_or_name() if entity else None
context['form'] = form
context['entity'] = entity
--- a/app/soc/views/models/notification.py Sat Apr 11 23:04:29 2009 +0000
+++ b/app/soc/views/models/notification.py Sun Apr 12 00:18:19 2009 +0000
@@ -195,7 +195,7 @@
self._logic.updateEntityProperties(entity, {'unread' : False} )
context['entity_type_url'] = self._params['url_name']
- context['entity_suffix'] = entity.key().id_or_name()
+ context['entity_suffix'] = entity.key().id_or_name() if entity else None
return True