Commit 3488ef1d by Jason Williams

forcing cleanup server side

parent 5ae09e66
...@@ -264,6 +264,8 @@ class CreateForm(forms.Form, SpamProtectionMixin): ...@@ -264,6 +264,8 @@ class CreateForm(forms.Form, SpamProtectionMixin):
else: else:
raise forms.ValidationError(_(u'A slug named "%s" already exists.') % already_urlpath.slug) raise forms.ValidationError(_(u'A slug named "%s" already exists.') % already_urlpath.slug)
slug = slug.lower()
slug = slug.replace('-', '_')
return slug return slug
def clean(self): def clean(self):
......
...@@ -30,10 +30,7 @@ ...@@ -30,10 +30,7 @@
var e = $("#id_slug")[0]; var e = $("#id_slug")[0];
if(!e._changed) { if(!e._changed) {
slug = URLify(this.value, 50); slug = URLify(this.value, 50);
/*wikislug = slug.replace(/\-/g, " ");*/ e.value = slug;
wikislug = slug.replace(/\w\S*/gi, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1);});
wikislug = wikislug.replace(/\s*/g, "");
e.value = wikislug;
} }
}); });
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment