From: Mark Huang Date: Tue, 19 Sep 2006 19:03:47 +0000 (+0000) Subject: - move assertion to right place X-Git-Tag: pycurl-7_13_1~748 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=083d020c57f546a0f9b6f56a6829efaafa00cb2d;p=plcapi.git - move assertion to right place --- diff --git a/PLC/Methods/AdmUpdateNode.py b/PLC/Methods/AdmUpdateNode.py index e5391aff..109e0af6 100644 --- a/PLC/Methods/AdmUpdateNode.py +++ b/PLC/Methods/AdmUpdateNode.py @@ -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"