Commit 13b3ccf0 authored by Kevin Deldycke's avatar Kevin Deldycke

Make the widget working even if localizer is not installed.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5245 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent dfc3186a
......@@ -443,8 +443,11 @@ class MultiRelationStringFieldValidator(Validator.LinesValidator, RelationField
, 'Localizer'
, None
)
N_ = localizer.erp5_ui.gettext
# Prepare a menu
if localizer is not None:
N_ = localizer.erp5_ui.gettext
else :
N_ = lambda msg, **kw: msg
menu_item_list = [('', '')]
new_object_menu_item_list = []
for p in portal_type:
......
......@@ -325,7 +325,10 @@ class RelationStringFieldValidator(Validator.StringValidator):
, 'Localizer'
, None
)
N_ = localizer.erp5_ui.gettext
if localizer is not None:
N_ = localizer.erp5_ui.gettext
else :
N_ = lambda msg, **kw: msg
# Get the current value
value = Validator.StringValidator.validate(self, field, key, REQUEST)
# If the value is the same as the current field value, do nothing
......
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