# HG changeset patch # User Pawel Solyga # Date 1224694988 0 # Node ID 3cf5630d86d1d922aa43a7931d38e1133c7718f7 # Parent cc603a815cad60f151eda49f8d9a85cfd02f45a6 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 diff -r cc603a815cad -r 3cf5630d86d1 app/soc/logic/models/base.py --- 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: diff -r cc603a815cad -r 3cf5630d86d1 app/soc/views/models/base.py --- 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