From 8fc9a29f74bbfa927cf0283daec81d3cd5f704cc Mon Sep 17 00:00:00 2001 From: mojtaba <121169359+mojtabapaso@users.noreply.github.com> Date: Thu, 31 Aug 2023 13:31:21 +0330 Subject: [PATCH] Update exceptions.py fix flake8 in code --- rest_framework/exceptions.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rest_framework/exceptions.py b/rest_framework/exceptions.py index 037d071fd..e03940ed7 100644 --- a/rest_framework/exceptions.py +++ b/rest_framework/exceptions.py @@ -203,11 +203,13 @@ class NotFound(APIException): default_detail = _('Not found.') default_code = 'not_found' + class Conflict(APIException): status_code = status.HTTP_409_CONFLICT default_detail = _('Conflict request.') default_code = 'conflict_error' - + + class MethodNotAllowed(APIException): status_code = status.HTTP_405_METHOD_NOT_ALLOWED default_detail = _('Method "{method}" not allowed.')