From c30a533de62aee7a9d69a2a95c319a184870f087 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Wed, 2 Apr 2008 21:15:49 -0400 Subject: [PATCH] Don't try to update ipauserobjectclasses or ipagroupobjectclasses since they aren't being displayed anymore. They will just get blanked. Also add some error handling in ipahelper.fix_incoming_fields() 438256 --- ipa-server/ipa-gui/ipagui/helpers/ipahelper.py | 10 +++++++--- .../ipa-gui/ipagui/subcontrollers/ipapolicy.py | 12 ++++++------ 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/ipa-server/ipa-gui/ipagui/helpers/ipahelper.py b/ipa-server/ipa-gui/ipagui/helpers/ipahelper.py index a33acc074..511e28daf 100644 --- a/ipa-server/ipa-gui/ipagui/helpers/ipahelper.py +++ b/ipa-server/ipa-gui/ipagui/helpers/ipahelper.py @@ -16,6 +16,7 @@ # import re +import logging def javascript_string_escape(input): """Escapes the ' " and \ characters in a string so @@ -50,8 +51,11 @@ def fix_incoming_fields(fields, fieldname, multifieldname): field, then removes the multiple field. """ fields[fieldname] = [] - for i in range(len(fields[multifieldname])): - fields[fieldname].append(fields[multifieldname][i][fieldname]) - del(fields[multifieldname]) + try: + for i in range(len(fields[multifieldname])): + fields[fieldname].append(fields[multifieldname][i][fieldname]) + del(fields[multifieldname]) + except Exception, e: + logging.warn("fix_incoming_fields error: " + str(e)) return fields diff --git a/ipa-server/ipa-gui/ipagui/subcontrollers/ipapolicy.py b/ipa-server/ipa-gui/ipagui/subcontrollers/ipapolicy.py index 8663098f1..1db062b40 100644 --- a/ipa-server/ipa-gui/ipagui/subcontrollers/ipapolicy.py +++ b/ipa-server/ipa-gui/ipagui/subcontrollers/ipapolicy.py @@ -163,12 +163,12 @@ class IPAPolicyController(IPAController): if new_ipapolicy.getValues('ipadefaultprimarygroup') != kw.get('ipadefaultprimarygroup'): policy_modified = True new_ipapolicy.setValue('ipadefaultprimarygroup', kw.get('ipadefaultprimarygroup')) - if new_ipapolicy.getValues('ipauserobjectclasses') != kw.get('ipauserobjectclasses'): - policy_modified = True - new_ipapolicy.setValue('ipauserobjectclasses', kw.get('ipauserobjectclasses')) - if new_ipapolicy.getValues('ipagroupobjectclasses') != kw.get('ipagroupobjectclasses'): - policy_modified = True - new_ipapolicy.setValue('ipagroupobjectclasses', kw.get('ipagroupobjectclasses')) +# if new_ipapolicy.getValues('ipauserobjectclasses') != kw.get('ipauserobjectclasses'): +# policy_modified = True +# new_ipapolicy.setValue('ipauserobjectclasses', kw.get('ipauserobjectclasses')) +# if new_ipapolicy.getValues('ipagroupobjectclasses') != kw.get('ipagroupobjectclasses'): +# policy_modified = True +# new_ipapolicy.setValue('ipagroupobjectclasses', kw.get('ipagroupobjectclasses')) if new_ipapolicy.getValues('ipadefaultemaildomain') != kw.get('ipadefaultemaildomain'): policy_modified = True new_ipapolicy.setValue('ipadefaultemaildomain', kw.get('ipadefaultemaildomain'))