mirror of
https://github.com/maciej3031/comixify.git
synced 2026-03-11 08:54:35 +00:00
13 lines
339 B
Python
13 lines
339 B
Python
|
|
from django.conf import settings
|
||
|
|
from rest_framework.exceptions import APIException
|
||
|
|
|
||
|
|
|
||
|
|
class FileExtensionError(APIException):
|
||
|
|
status_code = 400
|
||
|
|
default_detail = 'Invalid file extension'
|
||
|
|
|
||
|
|
|
||
|
|
class TooLargeFile(APIException):
|
||
|
|
status_code = 400
|
||
|
|
default_detail = f'File cannot be larger than {settings.MAX_FILE_SIZE/1000000} MB'
|