diff options
Diffstat (limited to 'ishtar_common/forms.py')
| -rw-r--r-- | ishtar_common/forms.py | 8 | 
1 files changed, 6 insertions, 2 deletions
| diff --git a/ishtar_common/forms.py b/ishtar_common/forms.py index 311f6fee4..448c06ceb 100644 --- a/ishtar_common/forms.py +++ b/ishtar_common/forms.py @@ -660,6 +660,10 @@ class ClosingDateFormSelection(IshtarForm):          super(ClosingDateFormSelection, self).__init__(*args, **kwargs) +def has_map(): +    return models.get_current_profile().mapping + +  def get_form_selection(          class_name, label, key, model, base_form, get_url,          not_selected_error=_(u"You should select an item."), new=False, @@ -688,8 +692,8 @@ def get_form_selection(          widget_kwargs['source_full'] = reverse_lazy(get_full_url)      if gallery:          widget_kwargs['gallery'] = True -    if map and models.get_current_profile().mapping: -        widget_kwargs['map'] = True +    if map: +        widget_kwargs['map'] = has_map      attrs[key] = forms.IntegerField(          label="", required=False,          validators=[models.valid_id(model)], | 
