diff roundup/cgi/templating.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 882fa4d9bead
children fac171f0f27b
line wrap: on
line diff
--- a/roundup/cgi/templating.py	Mon Aug 15 20:53:37 2016 -0400
+++ b/roundup/cgi/templating.py	Mon Aug 22 22:19:48 2016 +0200
@@ -1251,7 +1251,7 @@
             is_in = form.has_key(self._formname)
         except TypeError:
             is_in = False
-        if not self._value and is_in:
+        if is_in and (not self._value or self._client.form_wins):
             if isinstance(prop, hyperdb.Multilink):
                 value = lookupIds(self._db, prop,
                                   handleListCGIValue(form[self._formname]),

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