Commit 3488ef1d by Jason Williams

forcing cleanup server side

parent 5ae09e66
......@@ -264,6 +264,8 @@ class CreateForm(forms.Form, SpamProtectionMixin):
else:
raise forms.ValidationError(_(u'A slug named "%s" already exists.') % already_urlpath.slug)
slug = slug.lower()
slug = slug.replace('-', '_')
return slug
def clean(self):
......
......@@ -30,10 +30,7 @@
var e = $("#id_slug")[0];
if(!e._changed) {
slug = URLify(this.value, 50);
/*wikislug = slug.replace(/\-/g, " ");*/
wikislug = slug.replace(/\w\S*/gi, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1);});
wikislug = wikislug.replace(/\s*/g, "");
e.value = wikislug;
e.value = slug;
}
});
});
......
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