web/views/editcontroller.py
changeset 3386 ab797c5374b7
parent 3384 f76a38731bc1
child 3387 a357d4147eee
--- a/web/views/editcontroller.py	Wed Aug 05 09:10:32 2009 +0200
+++ b/web/views/editcontroller.py	Wed Aug 05 09:14:34 2009 +0200
@@ -83,8 +83,8 @@
         etype = formparams['__type']
         entity = self.vreg['etypes'].etype_class(etype)(self.req)
         entity.eid = eid = self._get_eid(formparams['eid'])
-        edited = self.req.form.get('__maineid') == formparams['eid']
         # let a chance to do some entity specific stuff.
+        is_main_entity = self.req.form.get('__maineid') == formparams['eid']
         entity.pre_web_edit()
         # create a rql query from parameters
         self.relations = []
@@ -135,7 +135,7 @@
             if rschema.is_final():
                 continue
             self.handle_relation(rschema, formparams, 'object', entity)
-        if edited:
+        if is_main_entity:
             self.notify_edited(entity)
         if formparams.has_key('__delete'):
             todelete = self.req.list_form_param('__delete', formparams, pop=True)
@@ -145,7 +145,7 @@
         if formparams.has_key('__insert'):
             toinsert = self.req.list_form_param('__insert', formparams, pop=True)
             self.insert_relations(parse_relations_descr(toinsert))
-        if edited: # only execute linkto for the main entity
+        if is_main_entity: # only execute linkto for the main entity
             self.execute_linkto(eid)
         return eid