server/hook.py
branchstable
changeset 5744 6b2a987370e8
parent 5538 752bc67064f2
child 5837 67c722b36f7c
--- a/server/hook.py	Fri Jun 11 18:48:17 2010 +0200
+++ b/server/hook.py	Mon Jun 14 18:58:03 2010 +0200
@@ -122,6 +122,7 @@
 _MARKER = object()
 def entity_oldnewvalue(entity, attr):
     """returns the couple (old attr value, new attr value)
+
     NOTE: will only work in a before_update_entity hook
     """
     # get new value and remove from local dict to force a db query to
@@ -130,6 +131,8 @@
     oldvalue = getattr(entity, attr)
     if newvalue is not _MARKER:
         entity[attr] = newvalue
+    else:
+        newvalue = oldvalue
     return oldvalue, newvalue