Skip to content

Commit

Permalink
Merge branch 'master' into fix-event-name-length-crashing
Browse files Browse the repository at this point in the history
  • Loading branch information
Joliv3r authored Sep 22, 2024
2 parents a193d9b + ffc3501 commit 0e9ec5e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
18 changes: 18 additions & 0 deletions nablapps/events/migrations/0015_alter_event_headline.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 10:59

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("events", "0014_auto_20220702_1315"),
]

operations = [
migrations.AlterField(
model_name="event",
name="headline",
field=models.CharField(blank=True, max_length=50, verbose_name="tittel"),
),
]
3 changes: 3 additions & 0 deletions nablapps/events/models/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class Event(

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
# a dictionary with the rules as second element.
Expand Down Expand Up @@ -127,6 +128,8 @@ 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 0e9ec5e

Please sign in to comment.