Commit 12a4e8aa authored by cathi's avatar cathi

Fixed a problem in the default insertion code.

parent a9e1db84
......@@ -83,7 +83,7 @@
#
##############################################################################
__version__='$Revision: 1.16 $'[11:-2]
__version__='$Revision: 1.17 $'[11:-2]
import regex, sys, os, string
from string import lower, atoi, rfind, split, strip, join, upper, find
......@@ -424,10 +424,11 @@ class HTTPRequest(BaseRequest):
if defaults:
for keys, values in defaults.items():
if not form.has_key(keys):
# if the form does not have the key and the
# form is not empty, set the default
# if the form does not have the key,
# set the default
form[keys]=values
else:
#The form has the key
if getattr(values, '__class__',0) is record:
# if the key is mapped to a record, get the
# record
......@@ -440,7 +441,7 @@ class HTTPRequest(BaseRequest):
# the attribute, set it to the default
setattr(r,k,v)
form[keys] = r
else:
elif values == type([]):
# the key is mapped to a list
l = form[keys]
for x in values:
......@@ -461,6 +462,10 @@ class HTTPRequest(BaseRequest):
if not a in l:
l.append(a)
form[keys] = l
else:
# The form has the key, the key is not mapped
# to a record or sequence so do nothing
pass
# Convert to tuples
if tuple_items:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment