Skip to content

Commit

Permalink
Order MemberGroup by name by default (#3452)
Browse files Browse the repository at this point in the history
* Order MemberGroup by name by default.

This wasn't ideal for the old i18n-capable version of concrexit,
but we dropped that so the comment is outdated.

This does likely mean some redundant sorting is done, but that's not an
issue.

* add migration
  • Loading branch information
ColonelPhantom authored Nov 9, 2023
1 parent 107a28a commit ca77f66
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
20 changes: 20 additions & 0 deletions website/activemembers/migrations/0045_alter_membergroup_options.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 4.2.7 on 2023-11-08 18:09

from django.db import migrations


class Migration(migrations.Migration):
dependencies = [
("activemembers", "0044_alter_membergroup_photo"),
]

operations = [
migrations.AlterModelOptions(
name="membergroup",
options={
"ordering": ["name"],
"verbose_name": "member group",
"verbose_name_plural": "member groups",
},
),
]
2 changes: 1 addition & 1 deletion website/activemembers/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def get_absolute_url(self):
class Meta:
verbose_name = _("member group")
verbose_name_plural = _("member groups")
# ordering is done in the manager, to sort on a translated field
ordering = ["name"]


class Committee(MemberGroup):
Expand Down

0 comments on commit ca77f66

Please sign in to comment.