diff options
author | 2019-11-20 18:21:39 +0100 | |
---|---|---|
committer | 2019-11-20 18:21:39 +0100 | |
commit | b23edc0704618db7f17bd3438a1931c1e37cb16d (patch) | |
tree | e3d8d59107aead98422180bdef75fad8069b0ffb /pydis_site/apps/staff | |
parent | Test for the attachment image to be in the staff log (diff) | |
parent | Update migration history (diff) |
Merge branch 'bot#549-show-attachments-staff' of https://github.com/python-discord/site into bot#549-show-attachments-staff
Diffstat (limited to 'pydis_site/apps/staff')
-rw-r--r-- | pydis_site/apps/staff/migrations/0002_add_is_staff_to_role_mappings.py | 18 | ||||
-rw-r--r-- | pydis_site/apps/staff/models/role_mapping.py | 5 |
2 files changed, 23 insertions, 0 deletions
diff --git a/pydis_site/apps/staff/migrations/0002_add_is_staff_to_role_mappings.py b/pydis_site/apps/staff/migrations/0002_add_is_staff_to_role_mappings.py new file mode 100644 index 00000000..0404d270 --- /dev/null +++ b/pydis_site/apps/staff/migrations/0002_add_is_staff_to_role_mappings.py @@ -0,0 +1,18 @@ +# Generated by Django 2.2.6 on 2019-10-20 14:19 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('staff', '0001_initial'), + ] + + operations = [ + migrations.AddField( + model_name='rolemapping', + name='is_staff', + field=models.BooleanField(default=False, help_text='Whether this role mapping relates to a Django staff group'), + ), + ] diff --git a/pydis_site/apps/staff/models/role_mapping.py b/pydis_site/apps/staff/models/role_mapping.py index 10c09cf1..8a1fac2e 100644 --- a/pydis_site/apps/staff/models/role_mapping.py +++ b/pydis_site/apps/staff/models/role_mapping.py @@ -21,6 +21,11 @@ class RoleMapping(models.Model): unique=True, # Unique in order to simplify group assignment logic ) + is_staff = models.BooleanField( + help_text="Whether this role mapping relates to a Django staff group", + default=False + ) + def __str__(self): """Returns the mapping, for display purposes.""" return f"@{self.role.name} -> {self.group.name}" |