# HG changeset patch # User Sverre Rabbelier # Date 1235666824 0 # Node ID bc6dc3bb8d2adaa876a9aa4719a95dc4a5be122d # Parent 6eb2c090d2be753dea8a547b0068e44781497b4d Remove _silentUpdateEntityProperties Instead, pass a silent flag to updateEtitytProperties. Patch by: Sverre Rabbelier diff -r 6eb2c090d2be -r bc6dc3bb8d2a app/soc/logic/models/base.py --- a/app/soc/logic/models/base.py Thu Feb 26 16:46:29 2009 +0000 +++ b/app/soc/logic/models/base.py Thu Feb 26 16:47:04 2009 +0000 @@ -323,7 +323,7 @@ return result - def updateEntityProperties(self, entity, entity_properties): + def updateEntityProperties(self, entity, entity_properties, silent=False): """Update existing entity using supplied properties. Args: @@ -341,21 +341,11 @@ entity = db.run_in_transaction(update) # call the _onUpdate method - self._onUpdate(entity) + if not silent: + self._onUpdate(entity) return entity - def _silentUpdateEntityProperties(self, entity, entity_properties): - """See _unsafeUpdateEntityProperties. - - Does not call _onUpdate. - """ - - def update(): - return self._unsafeUpdateEntityProperties(entity, entity_properties) - - return db.run_in_transaction(update) - def _unsafeUpdateEntityProperties(self, entity, entity_properties): """See updateEntityProperties. @@ -401,8 +391,8 @@ # there is no way to be sure if get_or_insert() returned a new entity or # got an existing one due to a race, so update with properties anyway, # in a transaction - entity = self._silentUpdateEntityProperties(entity, properties) - + entity = self.updateEntityProperties(entity, properties, silent=True) + if create_entity: # a new entity has been created call _onCreate self._onCreate(entity)