diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2023-03-01 17:31:44 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2023-03-01 17:31:44 +0100 |
commit | cbff90a09baa33a267966377338414b3cba870e8 (patch) | |
tree | 4f67022d715676eedd3457a47749ab154569a745 /ishtar_common/forms_common.py | |
parent | 2ecf1dd3333c8f130ecbad8787c5fc6503ae4f14 (diff) | |
download | Ishtar-cbff90a09baa33a267966377338414b3cba870e8.tar.bz2 Ishtar-cbff90a09baa33a267966377338414b3cba870e8.zip |
Search - Account: add "profile type" field
Diffstat (limited to 'ishtar_common/forms_common.py')
-rw-r--r-- | ishtar_common/forms_common.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/ishtar_common/forms_common.py b/ishtar_common/forms_common.py index f14799f53..4286ae9fd 100644 --- a/ishtar_common/forms_common.py +++ b/ishtar_common/forms_common.py @@ -783,11 +783,10 @@ class PersonSelect(CustomForm, TableSelect): ), validators=[models.valid_id(models.Organization)], ) - - def __init__(self, *args, **kwargs): - super(PersonSelect, self).__init__(*args, **kwargs) - self.fields["person_types"].choices = models.PersonType.get_types() - self.fields["title"].choices = models.TitleType.get_types() + TYPES = [ + FieldType("person_types", models.PersonType), + FieldType("title", models.TitleType), + ] class PersonFormSelection(CustomFormSearch): @@ -963,6 +962,10 @@ class SimplePersonForm(ManageOldType, NewItemForm): class PersonUserSelect(PersonSelect): ishtaruser__isnull = forms.NullBooleanField(label=_("Already has an account")) + profiles__profile_type = forms.ChoiceField(label=_("Profile type"), choices=[]) + TYPES = [ + FieldType("profiles__profile_type", models.ProfileType), + ] class PersonUserFormSelection(PersonFormSelection): |