Commit 91b4277a authored by Xiaowu Zhang's avatar Xiaowu Zhang

PreferenceConfiguratorItem: bt5_obj maybe not existe

parent d3f43ec4
......@@ -109,9 +109,10 @@ class PreferenceConfiguratorItem(ConfiguratorItemMixin, XMLObject):
preference_dict['preferred_section'] = organisation_path
preference.edit(**preference_dict)
bt5_obj = business_configuration.getSpecialiseValue()
current_template_preference_list = list(bt5_obj.getTemplatePreferenceList())
if preference.getId() not in current_template_preference_list:
current_template_preference_list.append(preference.getId())
bt5_obj.edit(template_preference_list=current_template_preference_list,)
if bt5_obj:
current_template_preference_list = list(bt5_obj.getTemplatePreferenceList())
if preference.getId() not in current_template_preference_list:
current_template_preference_list.append(preference.getId())
bt5_obj.edit(template_preference_list=current_template_preference_list,)
return error_list
......@@ -104,9 +104,10 @@ class SystemPreferenceConfiguratorItem(ConfiguratorItemMixin, XMLObject):
preference.edit(**preference_dict)
business_configuration = self.getBusinessConfigurationValue()
bt5_obj = business_configuration.getSpecialiseValue()
current_template_preference_list = list(bt5_obj.getTemplatePreferenceList())
if preference.getId() not in current_template_preference_list:
current_template_preference_list.append(preference.getId())
bt5_obj.edit(template_preference_list=current_template_preference_list,)
if bt5_obj:
current_template_preference_list = list(bt5_obj.getTemplatePreferenceList())
if preference.getId() not in current_template_preference_list:
current_template_preference_list.append(preference.getId())
bt5_obj.edit(template_preference_list=current_template_preference_list,)
return error_list
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