Code

fix the fix for ensuring POST
authorrichard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2>
Sat, 21 Mar 2009 21:58:49 +0000 (21:58 +0000)
committerrichard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2>
Sat, 21 Mar 2009 21:58:49 +0000 (21:58 +0000)
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4210 57a73879-2fb5-44c3-a270-3262357dd7e2

roundup/cgi/actions.py

index 425dec2d41b6ff992a91a179b8a1f909abb73116..0f42319da3eff1359dc7168959a4973082dea139 100755 (executable)
@@ -105,7 +105,7 @@ class RetireAction(Action):
         """Retire the context item."""
         # ensure modification comes via POST
         if self.client.env['REQUEST_METHOD'] != 'POST':
-            self.client.error_message.append(self._('Invalid request'))
+            raise roundup.exceptions.Reject(self._('Invalid request'))
 
         # if we want to view the index template now, then unset the itemid
         # context info (a special-case for retire actions on the index page)
@@ -284,7 +284,7 @@ class EditCSVAction(Action):
         """
         # ensure modification comes via POST
         if self.client.env['REQUEST_METHOD'] != 'POST':
-            self.client.error_message.append(self._('Invalid request'))
+            raise roundup.exceptions.Reject(self._('Invalid request'))
 
         # figure the properties list for the class
         cl = self.db.classes[self.classname]
@@ -587,7 +587,7 @@ class EditItemAction(EditCommon):
         """
         # ensure modification comes via POST
         if self.client.env['REQUEST_METHOD'] != 'POST':
-            self.client.error_message.append(self._('Invalid request'))
+            raise roundup.exceptions.Reject(self._('Invalid request'))
 
         user_activity = self.lastUserActivity()
         if user_activity:
@@ -633,7 +633,7 @@ class NewItemAction(EditCommon):
         '''
         # ensure modification comes via POST
         if self.client.env['REQUEST_METHOD'] != 'POST':
-            self.client.error_message.append(self._('Invalid request'))
+            raise roundup.exceptions.Reject(self._('Invalid request'))
 
         # parse the props from the form
         try:
@@ -819,7 +819,7 @@ class RegisterAction(RegoCommon, EditCommon):
         """
         # ensure modification comes via POST
         if self.client.env['REQUEST_METHOD'] != 'POST':
-            self.client.error_message.append(self._('Invalid request'))
+            raise roundup.exceptions.Reject(self._('Invalid request'))
 
         # parse the props from the form
         try:
@@ -937,7 +937,7 @@ class LoginAction(Action):
         """
         # ensure modification comes via POST
         if self.client.env['REQUEST_METHOD'] != 'POST':
-            self.client.error_message.append(self._('Invalid request'))
+            raise roundup.exceptions.Reject(self._('Invalid request'))
 
         # we need the username at a minimum
         if not self.form.has_key('__login_name'):
@@ -1086,11 +1086,11 @@ class Bridge(BaseAction):
     def permission(self, args):
         """Raise Unauthorised if the current user is not allowed to execute
         this action. Users may override this method."""
-        
+
         pass
 
     def handle(self, args):
-        
+
         raise NotImplementedError
 
 # vim: set filetype=python sts=4 sw=4 et si :