mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-04 12:30:11 +03:00
add global error messages
This commit is contained in:
parent
83c535e9cc
commit
88e995c310
|
@ -577,6 +577,8 @@ class Field(object):
|
|||
"""
|
||||
A helper method that simply raises a validation error.
|
||||
"""
|
||||
if hasattr(api_settings, 'global_error_messages'):
|
||||
self.error_messages.update(api_settings['global_error_messages'])
|
||||
try:
|
||||
msg = self.error_messages[key]
|
||||
except KeyError:
|
||||
|
|
Loading…
Reference in New Issue
Block a user