- move assertion to right place
authorMark Huang <mlhuang@cs.princeton.edu>
Tue, 19 Sep 2006 19:03:47 +0000 (19:03 +0000)
committerMark Huang <mlhuang@cs.princeton.edu>
Tue, 19 Sep 2006 19:03:47 +0000 (19:03 +0000)
PLC/Methods/AdmUpdateNode.py

index e5391af..109e0af 100644 (file)
@@ -53,12 +53,12 @@ class AdmUpdateNode(Method):
 
         node = nodes.values()[0]
 
+        # Authenticated function
+        assert self.caller is not None
+
         # If we are not an admin, make sure that the caller is a
         # member of the site at which the node is located.
         if 'admin' not in self.caller['roles']:
-            # Authenticated function
-            assert self.caller is not None
-
             if node['site_id'] not in self.caller['site_ids']:
                 raise PLCPermissionDenied, "Not allowed to delete nodes from specified site"