On déplace les permissions
This commit is contained in:
parent
2fc4073351
commit
d8dba17731
2 changed files with 27 additions and 3 deletions
24
elections/migrations/0026_auto_20210529_2246.py
Normal file
24
elections/migrations/0026_auto_20210529_2246.py
Normal 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"]},
|
||||||
|
),
|
||||||
|
]
|
|
@ -70,6 +70,9 @@ class Election(models.Model):
|
||||||
archived = models.BooleanField(_("archivée"), default=False)
|
archived = models.BooleanField(_("archivée"), default=False)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
permissions = [
|
||||||
|
("is_admin", _("Peut administrer des élections")),
|
||||||
|
]
|
||||||
ordering = ["-start_date", "-end_date"]
|
ordering = ["-start_date", "-end_date"]
|
||||||
|
|
||||||
|
|
||||||
|
@ -233,7 +236,4 @@ class User(AbstractUser):
|
||||||
return CONNECTION_METHODS.get(method, _("identifiants spécifiques"))
|
return CONNECTION_METHODS.get(method, _("identifiants spécifiques"))
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
permissions = [
|
|
||||||
("is_admin", _("Peut administrer des élections")),
|
|
||||||
]
|
|
||||||
ordering = ["username"]
|
ordering = ["username"]
|
||||||
|
|
Loading…
Reference in a new issue