File: exceptions.py

package info (click to toggle)
drf-extensions 0.8.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,308 kB
  • sloc: python: 7,421; makefile: 11
file content (9 lines) | stat: -rw-r--r-- 373 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
from django.utils.translation import gettext_lazy as _
from rest_framework import status
from rest_framework.exceptions import APIException


class PreconditionRequiredException(APIException):
    status_code = status.HTTP_428_PRECONDITION_REQUIRED
    default_detail = _('This "{method}" request is required to be conditional.')
    default_code = 'precondition_required'