From a193d9bad2567aa708140270b90f2222e39f276e Mon Sep 17 00:00:00 2001 From: Joliver Date: Sun, 22 Sep 2024 11:52:14 +0200 Subject: [PATCH] feat: allows 100 characters for slug --- .../events/migrations/0015_alter_event_slug.py | 18 ++++++++++++++++++ nablapps/events/models/event.py | 4 +--- 2 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 nablapps/events/migrations/0015_alter_event_slug.py diff --git a/nablapps/events/migrations/0015_alter_event_slug.py b/nablapps/events/migrations/0015_alter_event_slug.py new file mode 100644 index 00000000..3bb2b747 --- /dev/null +++ b/nablapps/events/migrations/0015_alter_event_slug.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.25 on 2024-09-22 11:50 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("events", "0014_auto_20220702_1315"), + ] + + operations = [ + migrations.AlterField( + model_name="event", + name="slug", + field=models.CharField(blank=True, max_length=100, null=True), + ), + ] diff --git a/nablapps/events/models/event.py b/nablapps/events/models/event.py index b56310c2..c93f70aa 100644 --- a/nablapps/events/models/event.py +++ b/nablapps/events/models/event.py @@ -30,7 +30,7 @@ class Event( Dukker opp som nyheter på forsiden. """ - headline = models.CharField(blank=True, max_length=50, verbose_name="tittel") + slug = models.CharField(blank=True, null=True, max_length=100) # Penalty_rules is a dict where key is an integer and value is # a tuple with the name of the rule as first element and @@ -127,8 +127,6 @@ def get_short_name(self): ) def save(self, *args, **kwargs): - if not self.slug: - self.slug = slugify(self.headline) super().save(*args, **kwargs) self.move_waiting_to_attending()