From ccac2c5da06d2cf6cc0c7c9aee56cbb4cda9a319 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 27 Sep 2022 11:09:04 +0200 Subject: Organization: add columns to table - add town search criteria (refs #5447) --- ishtar_common/forms_common.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'ishtar_common/forms_common.py') diff --git a/ishtar_common/forms_common.py b/ishtar_common/forms_common.py index 7f8394768..6f0d01427 100644 --- a/ishtar_common/forms_common.py +++ b/ishtar_common/forms_common.py @@ -112,7 +112,9 @@ def get_advanced_town_field(label=_("Town"), required=True): ) -def get_person_field(label=_("Person"), required=True, person_types=[]): +def get_person_field(label=_("Person"), required=True, person_types=None): + if not person_types: + person_types = [] # !FIXME hard_link, reverse_lazy doen't seem to work with formsets widget = None url = "/" + settings.URL_PATH + "autocomplete-person" @@ -467,6 +469,7 @@ class OrganizationSelect(CustomForm, TableSelect): ) name = forms.CharField(label=_("Name"), max_length=300) organization_type = forms.ChoiceField(label=_("Type"), choices=[]) + precise_town = get_town_field() def __init__(self, *args, **kwargs): super(OrganizationSelect, self).__init__(*args, **kwargs) -- cgit v1.2.3