mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-16 19:22:24 +03:00
added support of unicode chars and made regexp slimiliar like previous one
This commit is contained in:
parent
f4194c4684
commit
60d3aaa5af
|
@ -805,7 +805,7 @@ class SlugField(CharField):
|
|||
if self.allow_unicode:
|
||||
validator = RegexValidator(re.compile(r'^[-\w]+\Z', re.UNICODE), message=self.error_messages['invalid_unicode'])
|
||||
else:
|
||||
validator = RegexValidator(re.compile(r'^[-a-zA-Z0-9_]+$'), message=self.error_messages['invalid'])
|
||||
validator = RegexValidator(re.compile(r'^[-\w]+$'), message=self.error_messages['invalid'])
|
||||
self.validators.append(validator)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user