diff --git a/elections/migrations/0026_auto_20210529_2246.py b/elections/migrations/0026_auto_20210529_2246.py new file mode 100644 index 0000000..91230f1 --- /dev/null +++ b/elections/migrations/0026_auto_20210529_2246.py @@ -0,0 +1,24 @@ +# Generated by Django 3.2.3 on 2021-05-29 20:46 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("elections", "0025_alter_option_abbreviation"), + ] + + operations = [ + migrations.AlterModelOptions( + name="election", + options={ + "ordering": ["-start_date", "-end_date"], + "permissions": [("is_admin", "Peut administrer des élections")], + }, + ), + migrations.AlterModelOptions( + name="user", + options={"ordering": ["username"]}, + ), + ] diff --git a/elections/models.py b/elections/models.py index c7c61c8..07d1f17 100644 --- a/elections/models.py +++ b/elections/models.py @@ -70,6 +70,9 @@ class Election(models.Model): archived = models.BooleanField(_("archivée"), default=False) class Meta: + permissions = [ + ("is_admin", _("Peut administrer des élections")), + ] ordering = ["-start_date", "-end_date"] @@ -233,7 +236,4 @@ class User(AbstractUser): return CONNECTION_METHODS.get(method, _("identifiants spécifiques")) class Meta: - permissions = [ - ("is_admin", _("Peut administrer des élections")), - ] ordering = ["username"]