Fix not working Create views (committed in r864). Check if entity exist in constructKeyNameSuffix funtion and apply changes to affected files.
Patch by: Pawel Solyga
Review by: to-be-reviewed
--- a/app/soc/logic/models/base.py Wed Oct 22 16:55:35 2008 +0000
+++ b/app/soc/logic/models/base.py Wed Oct 22 17:03:08 2008 +0000
@@ -151,6 +151,9 @@
of this entity.
"""
+ if not entity:
+ return None
+
suffix = []
for field in entity.KEY_FIELDS:
--- a/app/soc/views/models/base.py Wed Oct 22 16:55:35 2008 +0000
+++ b/app/soc/views/models/base.py Wed Oct 22 17:03:08 2008 +0000
@@ -352,10 +352,7 @@
form: the form that will be used
"""
- if entity:
- suffix = self._logic.constructKeyNameSuffix(entity)
- else:
- suffix = None
+ suffix = self._logic.constructKeyNameSuffix(entity)
context['form'] = form
context['entity'] = entity