-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow pages to be moved to slugs with Unicode characters in them #193
base: master
Are you sure you want to change the base?
Conversation
merge changes from master
|
||
class WikiSlugField(forms.CharField): | ||
""" | ||
In future versions of Django, we might be able to define this field as | ||
the default field directly on the model. For now, it's used in CreateForm. | ||
""" | ||
|
||
default_validators = [validators.validate_slug, validate_slug_numbers] | ||
default_validators = [validate_slug_ss, validate_slug_numbers] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why distinguish validate_slug_ss
and validate_unicode_slug_adp
here? If this is for article titles in general it shouldn't refer to supersenses and adpositions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the distinction is Unicode vs. non-Unicode, will validators.validate_slug
will continue to work on this line?
|
||
def __init__(self, *args, **kwargs): | ||
self.allow_unicode = kwargs.pop('allow_unicode', False) | ||
if self.allow_unicode: | ||
self.default_validators = [ | ||
validators.validate_unicode_slug, | ||
validate_unicode_slug_adp, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does the validators.validate_unicode_slug
regex look like? I think we just need to make it a tiny bit more permissive to allow modifier characters.
So that I can move the Hindi pages to the Devanagari slugs. This fixes the regexes that govern moving pages.
(Has been tested locally but testing it again won't hurt)