# HG changeset patch # User Lennard de Rijk # Date 1235214179 0 # Node ID f8c762a33a43aca38460a39ce85319e2af77e9f3 # Parent 54960277c85d9105286ab6567ad1d735cbac8ae6 Since scope does not change we do not need to call getFromKeyName every time. Patch by: Lennard de Rijk Reviewed by: to-be-reviewed diff -r 54960277c85d -r f8c762a33a43 app/soc/views/models/base.py --- 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.