From 47c0a482f67f34732dfbacc7153f380b0d4b8893 Mon Sep 17 00:00:00 2001 From: Thomas Steen Rasmussen Date: Wed, 8 Mar 2017 02:02:51 +0100 Subject: [PATCH] reserve the slug 'created' to stop creative souls from creating a url conflict --- src/program/models.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/program/models.py b/src/program/models.py index 705ec486..69f80043 100644 --- a/src/program/models.py +++ b/src/program/models.py @@ -196,4 +196,8 @@ class Speaker(UserSubmittedModel): def get_absolute_url(self): 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'})