Skip to content
Snippets Groups Projects
Verified Commit 78616770 authored by Ernesto Rico Schmidt's avatar Ernesto Rico Schmidt
Browse files

feat: add permissions and groups

parent 043965d2
No related branches found
No related tags found
1 merge request!29Use docker main tag
# Generated by Django 4.2.6 on 2023-12-07 20:29
from django.db import migrations
def add_groups(apps, _):
Group = apps.get_model("auth", "Group")
Group.objects.get_or_create(name="Program")
Group.objects.get_or_create(name="Broadcast")
Group.objects.get_or_create(name="BroadcastPlus")
class Migration(migrations.Migration):
dependencies = [
("program", "0075_remove_timeslot_language_remove_timeslot_topic_and_more"),
]
operations = [
migrations.AlterModelOptions(
name="host",
options={
"ordering": ("name",),
"permissions": [
("change_biography", "Can change biography"),
("change_email", "Can change email"),
("change_image", "Can change image"),
("change_name", "Can change name"),
],
},
),
migrations.AlterModelOptions(
name="show",
options={
"ordering": ("slug",),
"permissions": [
("change_description", "Can change description"),
("change_email", "Can change email"),
("change_image", "Can change image"),
("change_logo", "Can change logo"),
("change_name", "Can change name"),
("change_short_description", "Can change short_description"),
],
},
),
migrations.RunPython(code=add_groups),
]
......@@ -173,6 +173,12 @@ class Host(models.Model):
class Meta:
ordering = ("name",)
permissions = [
("change_biography", "Can change biography"),
("change_email", "Can change email"),
("change_image", "Can change image"),
("change_name", "Can change name"),
]
def __str__(self):
return self.name
......@@ -251,6 +257,14 @@ class Show(models.Model):
class Meta:
ordering = ("slug",)
permissions = [
("change_description", "Can change description"),
("change_email", "Can change email"),
("change_image", "Can change image"),
("change_logo", "Can change logo"),
("change_name", "Can change name"),
("change_short_description", "Can change short_description"),
]
def __str__(self):
return self.name
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment