summaryrefslogtreecommitdiff
path: root/ishtar_common
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common')
-rw-r--r--ishtar_common/forms_common.py13
-rw-r--r--ishtar_common/models.py4
2 files changed, 12 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):
diff --git a/ishtar_common/models.py b/ishtar_common/models.py
index 096a5e0a7..80a6a9141 100644
--- a/ishtar_common/models.py
+++ b/ishtar_common/models.py
@@ -2808,6 +2808,10 @@ class Person(Address, Merge, OwnPerms, ValueGetter, MainItem):
pgettext_lazy("key for text search", "has-account"),
"ishtaruser__isnull",
),
+ "profiles__profile_type": SearchAltName(
+ pgettext_lazy("key for text search", "profile-type"),
+ "profiles__profile_type__label__iexact",
+ ),
}
QA_EDIT = QuickAction(
url="person-qa-bulk-update",