summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2008-06-03 14:55:24 -0400
committerRob Crittenden <rcritten@redhat.com>2008-06-09 22:15:22 -0400
commitad3e4d4ed5cb8cf7da2915f29584cd511df3bb15 (patch)
tree5863f7d52cc37d52d3c0fd10cc961ba86bb0541c
parent42cada4594ee34d570f90385d5994fea1e4741b4 (diff)
downloadfreeipa-ad3e4d4ed5cb8cf7da2915f29584cd511df3bb15.tar.gz
freeipa-ad3e4d4ed5cb8cf7da2915f29584cd511df3bb15.tar.xz
freeipa-ad3e4d4ed5cb8cf7da2915f29584cd511df3bb15.zip
Ignore empty values when converting a multi-valued form field back to a list. This will prevent validation errors when validate.UniqueList() is executed.
449785
-rw-r--r--ipa-server/ipa-gui/ipagui/helpers/ipahelper.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/ipa-server/ipa-gui/ipagui/helpers/ipahelper.py b/ipa-server/ipa-gui/ipagui/helpers/ipahelper.py
index 511e28daf..4eb7644cf 100644
--- a/ipa-server/ipa-gui/ipagui/helpers/ipahelper.py
+++ b/ipa-server/ipa-gui/ipagui/helpers/ipahelper.py
@@ -53,7 +53,8 @@ def fix_incoming_fields(fields, fieldname, multifieldname):
fields[fieldname] = []
try:
for i in range(len(fields[multifieldname])):
- fields[fieldname].append(fields[multifieldname][i][fieldname])
+ if fields[multifieldname][i][fieldname] is not None and len(fields[multifieldname][i][fieldname]) > 0:
+ fields[fieldname].append(fields[multifieldname][i][fieldname])
del(fields[multifieldname])
except Exception, e:
logging.warn("fix_incoming_fields error: " + str(e))