Skip to content

Commit

Permalink
added support of unicode chars and made regexp slimiliar like previou…
Browse files Browse the repository at this point in the history
…s one
  • Loading branch information
igeni committed Mar 23, 2024
1 parent f4194c4 commit 60d3aaa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rest_framework/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ def __init__(self, allow_unicode=False, **kwargs):
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)


Expand Down

0 comments on commit 60d3aaa

Please sign in to comment.