Skip to content

Commit

Permalink
feat: allows 100 characters for slug
Browse files Browse the repository at this point in the history
  • Loading branch information
Joliv3r committed Sep 22, 2024
1 parent 940d4f3 commit a193d9b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
18 changes: 18 additions & 0 deletions nablapps/events/migrations/0015_alter_event_slug.py
Original file line number Diff line number Diff line change
@@ -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),
),
]
4 changes: 1 addition & 3 deletions nablapps/events/models/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()

Expand Down

0 comments on commit a193d9b

Please sign in to comment.