mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-05 04:50:12 +03:00
Fix comment around importing exception best practices
This commit is contained in:
parent
0cbfbc27d8
commit
21e97b67dc
|
@ -59,11 +59,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