Since scope does not change we do not need to call getFromKeyName every time.
Patch by: Lennard de Rijk
Reviewed by: to-be-reviewed
--- a/app/soc/views/models/base.py Sat Feb 21 10:57:02 2009 +0000
+++ b/app/soc/views/models/base.py Sat Feb 21 11:02:59 2009 +0000
@@ -672,9 +672,12 @@
if 'scope_path' not in fields:
return
- scope = self._params['scope_logic'].logic.getFromKeyName(
- fields['scope_path'])
- fields['scope'] = scope
+ if entity:
+ fields['scope'] = entity.scope
+ else:
+ scope = self._params['scope_logic'].logic.getFromKeyName(
+ fields['scope_path'])
+ fields['scope'] = scope
def _public(self, request, entity, context):
"""Performs any required processing to get an entity's public page.