From 9c057997141df7aef07c7a2e76005cc932b1f261 Mon Sep 17 00:00:00 2001 From: Corey Oordt Date: Thu, 22 Oct 2009 12:36:49 -0400 Subject: [PATCH] Finished the debugging and changed the logic --- categories/admin.py | 2 +- sample/settings.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/categories/admin.py b/categories/admin.py index 5296de9..7965665 100644 --- a/categories/admin.py +++ b/categories/admin.py @@ -31,7 +31,7 @@ class CategoryAdminForm(forms.ModelForm): model = Category def clean_slug(self): - if self.instance is None or ALLOW_SLUG_CHANGE: + if self.instance is None or not ALLOW_SLUG_CHANGE: self.cleaned_data['slug'] = slugify(self.cleaned_data['name']) return self.cleaned_data['slug'] diff --git a/sample/settings.py b/sample/settings.py index 3a7feaf..958c3d9 100644 --- a/sample/settings.py +++ b/sample/settings.py @@ -84,4 +84,5 @@ INSTALLED_APPS = ( 'editor', 'mptt', ) -EDITOR_MEDIA_PATH = '/static/editor/' \ No newline at end of file +EDITOR_MEDIA_PATH = '/static/editor/' +CATEGORIES_ALLOW_SLUG_CHANGE = True \ No newline at end of file