mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-05 13:00:12 +03:00
Merge 21e97b67dc
into a0602bce4c
This commit is contained in:
commit
056b6003c7
|
@ -112,11 +112,11 @@ class APIException(Exception):
|
||||||
|
|
||||||
|
|
||||||
# The recommended style for using `ValidationError` is to keep it namespaced
|
# The recommended style for using `ValidationError` is to keep it namespaced
|
||||||
# under `serializers`, in order to minimize potential confusion with Django's
|
# under `exceptions`, in order to minimize potential confusion with Django's
|
||||||
# built in `ValidationError`. For example:
|
# built in `ValidationError`. For example:
|
||||||
#
|
#
|
||||||
# from rest_framework import serializers
|
# from rest_framework import exceptions
|
||||||
# raise serializers.ValidationError('Value was invalid')
|
# raise exceptions.ValidationError('Value was invalid')
|
||||||
|
|
||||||
class ValidationError(APIException):
|
class ValidationError(APIException):
|
||||||
status_code = status.HTTP_400_BAD_REQUEST
|
status_code = status.HTTP_400_BAD_REQUEST
|
||||||
|
|
Loading…
Reference in New Issue
Block a user