reserve the slug 'created' to stop creative souls from creating a url conflict

This commit is contained in:
Thomas Steen Rasmussen 2017-03-08 02:02:51 +01:00
parent 271bfccfff
commit 47c0a482f6

View file

@ -196,4 +196,8 @@ class Speaker(UserSubmittedModel):
def get_absolute_url(self): def get_absolute_url(self):
return reverse_lazy('speaker_detail', kwargs={'camp_slug': self.camp.slug, 'slug': self.slug}) return reverse_lazy('speaker_detail', kwargs={'camp_slug': self.camp.slug, 'slug': self.slug})
def clean(self):
if self.slug == "create":
# this is a reserved word used in urls.py
raise ValidationError({'name': 'This name is reserved, please choose another'})