Fix scope lookup for unscoped entities
authorSverre Rabbelier <srabbelier@gmail.com>
Sat, 06 Dec 2008 12:13:19 +0000
changeset 677 c8f24e3078b8
parent 676 c6433532ddff
child 678 b982d9175605
Fix scope lookup for unscoped entities As scope_logic is now always set (since r1250), we need to check if it is None, rather than check if it exists. Patch by: Sverre Rabbelier
app/soc/views/models/base.py
--- a/app/soc/views/models/base.py	Sat Dec 06 12:12:58 2008 +0000
+++ b/app/soc/views/models/base.py	Sat Dec 06 12:13:19 2008 +0000
@@ -508,7 +508,7 @@
     """
 
     # If scope_logic is not defined, this entity has no scope
-    if 'scope_logic' not in self._params:
+    if not self._params['scope_logic']:
       return
 
     scope = self._params['scope_logic'].logic.getFromKeyName(fields['scope_path'])
@@ -535,7 +535,8 @@
     """
 
     # fill in the email field with the data from the entity
-    form.fields['scope_path'].initial = entity.scope_path
+    if 'scope_path' in form.fields:
+      form.fields['scope_path'].initial = entity.scope_path
 
   def _editSeed(self, request, seed):
     """Performs any required processing on the form to get its edit page.