mirror of
https://github.com/Hopiu/django.git
synced 2026-04-17 13:31:09 +00:00
Prevented evaluation of a possible lazy message
As far as possible, message evaluation should not happen in field __init__ (often run at import time).
This commit is contained in:
parent
1892ced10a
commit
cecbb71312
1 changed files with 1 additions and 1 deletions
|
|
@ -530,7 +530,7 @@ class RegexField(CharField):
|
|||
'Enter a valid value' is too generic for you.
|
||||
"""
|
||||
# error_message is just kept for backwards compatibility:
|
||||
if error_message:
|
||||
if error_message is not None:
|
||||
error_messages = kwargs.get('error_messages') or {}
|
||||
error_messages['invalid'] = error_message
|
||||
kwargs['error_messages'] = error_messages
|
||||
|
|
|
|||
Loading…
Reference in a new issue