diff --git a/pydis_site/apps/api/migrations/0070_auto_20210618_2114.py b/pydis_site/apps/api/migrations/0070_auto_20210618_2114.py new file mode 100644 index 000000000..1d25e421d --- /dev/null +++ b/pydis_site/apps/api/migrations/0070_auto_20210618_2114.py @@ -0,0 +1,19 @@ +# Generated by Django 3.0.14 on 2021-06-18 21:14 + +import django.core.validators +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('api', '0069_documentationlink_validators'), + ] + + operations = [ + migrations.AlterField( + model_name='role', + name='permissions', + field=models.BigIntegerField(help_text='The integer value of the permission bitset of this role from Discord.', validators=[django.core.validators.MinValueValidator(limit_value=0, message='Role permissions cannot be negative.')]), + ), + ] diff --git a/pydis_site/apps/api/models/bot/role.py b/pydis_site/apps/api/models/bot/role.py index cfadfec45..733a8e08a 100644 --- a/pydis_site/apps/api/models/bot/role.py +++ b/pydis_site/apps/api/models/bot/role.py @@ -1,6 +1,6 @@ from __future__ import annotations -from django.core.validators import MaxValueValidator, MinValueValidator +from django.core.validators import MinValueValidator from django.db import models from pydis_site.apps.api.models.mixins import ModelReprMixin @@ -38,16 +38,12 @@ class Role(ModelReprMixin, models.Model): ), help_text="The integer value of the colour of this role from Discord." ) - permissions = models.IntegerField( + permissions = models.BigIntegerField( validators=( MinValueValidator( limit_value=0, message="Role permissions cannot be negative." ), - MaxValueValidator( - limit_value=2 << 32, - message="Role permission bitset exceeds value of having all permissions" - ) ), help_text="The integer value of the permission bitset of this role from Discord." )