comparison roundup/cgi/client.py @ 5166:232c74973a56

issue1408570: fix that form values are lost .. on edit exceptions. This occured for example if editing an issue with the classic template and setting 'superseder' to a non-existing issue number. All changes to the form where the original field was non-empty were lost.
author Ralf Schlatterbeck <rsc@runtux.com>
date Mon, 22 Aug 2016 22:19:48 +0200
parents a86860224d80
children 349bef975367
comparison
equal deleted inserted replaced
5165:a86860224d80 5166:232c74973a56
293 self.instance = instance 293 self.instance = instance
294 self.request = request 294 self.request = request
295 self.env = env 295 self.env = env
296 self.setTranslator(translator) 296 self.setTranslator(translator)
297 self.mailer = Mailer(instance.config) 297 self.mailer = Mailer(instance.config)
298 # If True the form contents wins over the database contents when
299 # rendering html properties. This is set when an error occurs so
300 # that we don't lose submitted form contents.
301 self.form_wins = False
298 302
299 # save off the path 303 # save off the path
300 self.path = env['PATH_INFO'] 304 self.path = env['PATH_INFO']
301 305
302 # this is the base URL for this tracker 306 # this is the base URL for this tracker
419 def add_ok_message(self, msg, escape=True): 423 def add_ok_message(self, msg, escape=True):
420 add_message(self._ok_message, msg, escape) 424 add_message(self._ok_message, msg, escape)
421 425
422 def add_error_message(self, msg, escape=True): 426 def add_error_message(self, msg, escape=True):
423 add_message(self._error_message, msg, escape) 427 add_message(self._error_message, msg, escape)
428 # Want to interpret form values when rendering when an error
429 # occurred:
430 self.form_wins = True
424 431
425 def inner_main(self): 432 def inner_main(self):
426 """Process a request. 433 """Process a request.
427 434
428 The most common requests are handled like so: 435 The most common requests are handled like so:

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