summaryrefslogtreecommitdiff
path: root/ishtar_common/forms_common.py
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common/forms_common.py')
-rw-r--r--ishtar_common/forms_common.py13
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):