mirror of https://github.com/zulip/zulip.git
settings: Reorder custom profile field types.
This commit alphabetizes the custom profile field types in the settings UI. Fixes #28511.
This commit is contained in:
parent
9917ffa220
commit
60225591dc
|
@ -14,13 +14,13 @@ class Migration(migrations.Migration):
|
|||
name="field_type",
|
||||
field=models.PositiveSmallIntegerField(
|
||||
choices=[
|
||||
(1, "Text (short)"),
|
||||
(2, "Text (long)"),
|
||||
(4, "Date"),
|
||||
(5, "Link"),
|
||||
(7, "External account"),
|
||||
(8, "Pronouns"),
|
||||
(5, "Link"),
|
||||
(3, "List of options"),
|
||||
(8, "Pronouns"),
|
||||
(2, "Text (long)"),
|
||||
(1, "Text (short)"),
|
||||
(6, "Users"),
|
||||
],
|
||||
default=1,
|
||||
|
|
|
@ -120,7 +120,9 @@ class CustomProfileField(models.Model):
|
|||
(PRONOUNS, gettext_lazy("Pronouns"), check_short_string, str, "PRONOUNS"),
|
||||
]
|
||||
|
||||
ALL_FIELD_TYPES = [*FIELD_TYPE_DATA, *SELECT_FIELD_TYPE_DATA, *USER_FIELD_TYPE_DATA]
|
||||
ALL_FIELD_TYPES = sorted(
|
||||
[*FIELD_TYPE_DATA, *SELECT_FIELD_TYPE_DATA, *USER_FIELD_TYPE_DATA], key=lambda x: x[1]
|
||||
)
|
||||
|
||||
FIELD_VALIDATORS: Dict[int, Validator[ProfileDataElementValue]] = {
|
||||
item[0]: item[2] for item in FIELD_TYPE_DATA
|
||||
|
|
Loading…
Reference in New Issue