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 ...@@ -443,8 +443,11 @@ class MultiRelationStringFieldValidator(Validator.LinesValidator, RelationField
, 'Localizer' , 'Localizer'
, None , None
) )
N_ = localizer.erp5_ui.gettext
# Prepare a menu # Prepare a menu
if localizer is not None:
N_ = localizer.erp5_ui.gettext
else :
N_ = lambda msg, **kw: msg
menu_item_list = [('', '')] menu_item_list = [('', '')]
new_object_menu_item_list = [] new_object_menu_item_list = []
for p in portal_type: for p in portal_type:
......
...@@ -325,7 +325,10 @@ class RelationStringFieldValidator(Validator.StringValidator): ...@@ -325,7 +325,10 @@ class RelationStringFieldValidator(Validator.StringValidator):
, 'Localizer' , 'Localizer'
, None , 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 # Get the current value
value = Validator.StringValidator.validate(self, field, key, REQUEST) value = Validator.StringValidator.validate(self, field, key, REQUEST)
# If the value is the same as the current field value, do nothing # 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