From 8a954029a2f0f22cde599afee3ff8195680e621e Mon Sep 17 00:00:00 2001 From: vivekashok1221 Date: Fri, 17 Feb 2023 11:40:29 +0530 Subject: Add jump_url field to infraction model --- .../apps/api/migrations/0086_infraction_jump_url.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 pydis_site/apps/api/migrations/0086_infraction_jump_url.py (limited to 'pydis_site/apps/api/migrations') diff --git a/pydis_site/apps/api/migrations/0086_infraction_jump_url.py b/pydis_site/apps/api/migrations/0086_infraction_jump_url.py new file mode 100644 index 00000000..e32219c8 --- /dev/null +++ b/pydis_site/apps/api/migrations/0086_infraction_jump_url.py @@ -0,0 +1,18 @@ +# Generated by Django 4.1.6 on 2023-02-13 22:23 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('api', '0085_add_thread_id_to_nominations'), + ] + + operations = [ + migrations.AddField( + model_name='infraction', + name='jump_url', + field=models.CharField(default='', help_text='The jump url to message invoking the infraction.', max_length=88), + ), + ] -- cgit v1.2.3 From ed3577652d620057cc87bbc74775548066cfdc8f Mon Sep 17 00:00:00 2001 From: vivekashok1221 Date: Fri, 10 Mar 2023 23:11:35 +0530 Subject: Replace CharField with URLField and set default to None --- pydis_site/apps/api/migrations/0086_infraction_jump_url.py | 4 ++-- pydis_site/apps/api/models/bot/infraction.py | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'pydis_site/apps/api/migrations') diff --git a/pydis_site/apps/api/migrations/0086_infraction_jump_url.py b/pydis_site/apps/api/migrations/0086_infraction_jump_url.py index e32219c8..7ae65751 100644 --- a/pydis_site/apps/api/migrations/0086_infraction_jump_url.py +++ b/pydis_site/apps/api/migrations/0086_infraction_jump_url.py @@ -1,4 +1,4 @@ -# Generated by Django 4.1.6 on 2023-02-13 22:23 +# Generated by Django 4.1.7 on 2023-03-10 17:25 from django.db import migrations, models @@ -13,6 +13,6 @@ class Migration(migrations.Migration): migrations.AddField( model_name='infraction', name='jump_url', - field=models.CharField(default='', help_text='The jump url to message invoking the infraction.', max_length=88), + field=models.URLField(default=None, help_text='The jump url to message invoking the infraction.', max_length=88, null=True), ), ] diff --git a/pydis_site/apps/api/models/bot/infraction.py b/pydis_site/apps/api/models/bot/infraction.py index ea0277c3..660f1cb4 100644 --- a/pydis_site/apps/api/models/bot/infraction.py +++ b/pydis_site/apps/api/models/bot/infraction.py @@ -69,8 +69,9 @@ class Infraction(ModelReprMixin, models.Model): help_text="Whether a DM was sent to the user when infraction was applied." ) - jump_url = models.CharField( - default='', + jump_url = models.URLField( + default=None, + null=True, max_length=88, help_text=( "The jump url to message invoking the infraction." -- cgit v1.2.3