On déplace les permissions

This commit is contained in:
Tom Hubrecht 2021-05-30 00:40:32 +02:00
parent 2fc4073351
commit d8dba17731
2 changed files with 27 additions and 3 deletions

View file

@ -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"]},
),
]

View file

@ -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"]