Code

forward-port of fix from maint-0-6
authorrichard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2>
Wed, 25 Feb 2004 09:40:46 +0000 (09:40 +0000)
committerrichard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2>
Wed, 25 Feb 2004 09:40:46 +0000 (09:40 +0000)
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@2118 57a73879-2fb5-44c3-a270-3262357dd7e2

CHANGES.txt
roundup/cgi/templating.py

index 5c8a5fcbb777d8d03ef0e55e6664d97c608b2d6f..60abfcbed0ba1281bcfebd2669c5791f676e19e5 100644 (file)
@@ -73,13 +73,23 @@ Cleanup:
   * exceptions.py - all exceptions
   * form_parser.py - parsePropsFromForm & extractFormList in a FormParser class
 
-2004-??-?? 0.6.6
+
+2004-??-?? 0.6.7
+Fixed:
+- made error on create consistent with edit when user enters invalid data
+  for Multilink and Link form fields (sf bug 904072)
+
+
+2004-02-25 0.6.6
 Fixed:
 - don't insert spaces into designators, it just confuses users (sf bug
   898087)
 - Eudora can't handle utf-8 headers. We love Eudora. (sf bug 900046)
 - fixed bug in args to new DateHTMLProperty in the local() method (sf bug
   901444)
+- fixed registration (sf bug 903283)
+- also changed rego to not use a 302 during confirmation, as this seems to
+  confuse some email clients or browsers.
 
 
 2004-02-16 0.6.5
index 225563e7c30e2311809f3e43a0979bf4f872a2b7..de9d09605072cd78e789705e5f4634a33e2a468b 100644 (file)
@@ -276,7 +276,10 @@ class HTMLDatabase:
             m.append(HTMLClass(self._client, item))
         return r
 
-def lookupIds(db, prop, ids, num_re=re.compile('-?\d+')):
+def lookupIds(db, prop, ids, fail_ok=False, num_re=re.compile('-?\d+')):
+    ''' "fail_ok" should be specified if we wish to pass through bad values
+        (most likely form values that we wish to represent back to the user)
+    '''
     cl = db.getclass(prop.classname)
     l = []
     for entry in ids:
@@ -285,9 +288,10 @@ def lookupIds(db, prop, ids, num_re=re.compile('-?\d+')):
         else:
             try:
                 l.append(cl.lookup(entry))
-            except KeyError:
-                # ignore invalid keys
-                pass
+            except (TypeError, KeyError):
+                if fail_ok:
+                    # pass through the bad value
+                    l.append(entry)
     return l
 
 class HTMLPermissions:
@@ -382,11 +386,12 @@ class HTMLClass(HTMLInputMixin, HTMLPermissions):
             if form.has_key(item):
                 if isinstance(prop, hyperdb.Multilink):
                     value = lookupIds(self._db, prop,
-                        handleListCGIValue(form[item]))
+                        handleListCGIValue(form[item]), fail_ok=True)
                 elif isinstance(prop, hyperdb.Link):
                     value = form[item].value.strip()
                     if value:
-                        value = lookupIds(self._db, prop, [value])[0]
+                        value = lookupIds(self._db, prop, [value],
+                            fail_ok=True)[0]
                     else:
                         value = None
                 else: