diff roundup/cgi/actions.py @ 4624:21705126dafa

Committed edited fix for issue2550712 by Cedric Krier.
author Bernhard Reiter <bernhard@intevation.de>
date Mon, 14 May 2012 17:46:15 +0200
parents 4f9c3858b671
children ca692423e401
line wrap: on
line diff
--- a/roundup/cgi/actions.py	Mon May 14 14:17:07 2012 +0200
+++ b/roundup/cgi/actions.py	Mon May 14 17:46:15 2012 +0200
@@ -1035,6 +1035,18 @@
         columns = request.columns
         klass = self.db.getclass(request.classname)
 
+        # check if all columns exist on class
+        # the exception must be raised before sending header
+        props = klass.getprops()
+        for cname in columns:
+            if cname not in props:
+                # TODO raise exceptions.NotFound(.....) does not give message
+                # so using SeriousError instead
+                self.client.response_code = 404
+                raise exceptions.SeriousError(
+                    self._('Column "%(column)s" not found on %(class)s')
+                    % {'column': cgi.escape(cname), 'class': request.classname})
+
         # full-text search
         if request.search_text:
             matches = self.db.indexer.search(

Roundup Issue Tracker: http://roundup-tracker.org/