server/session.py
changeset 4767 74b8e39d4825
parent 4759 af2e6c377c71
child 4834 b718626a0e60
--- a/server/session.py	Wed Mar 03 18:30:25 2010 +0100
+++ b/server/session.py	Wed Mar 03 18:31:08 2010 +0100
@@ -585,10 +585,10 @@
     def add_operation(self, operation, index=None):
         """add an observer"""
         assert self.commit_state != 'commit'
-        if index is not None:
+        if index is None:
+            self.pending_operations.append(operation)
+        else:
             self.pending_operations.insert(index, operation)
-        else:
-            self.pending_operations.append(operation)
 
     # querier helpers #########################################################