Skip to content

Commit

Permalink
fix: slug now gets created separate to SlugField upon creation
Browse files Browse the repository at this point in the history
  • Loading branch information
Joliv3r committed Sep 21, 2024
1 parent 282c7de commit 14cdb19
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions nablapps/events/models/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from django.core.exceptions import ValidationError
from django.db import IntegrityError, models
from django.urls import reverse
from django.utils.text import slugify

from nablapps.core.models import TimeStamped, WithPicture
from nablapps.jobs.models import Company
Expand Down Expand Up @@ -124,6 +125,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 14cdb19

Please sign in to comment.