mirror of
https://github.com/django-helpdesk/django-helpdesk.git
synced 2025-08-13 17:57:44 +02:00
Initial isort configuration
Will fail build if imports are not sorted correctly
This commit is contained in:
@ -2,16 +2,18 @@
|
||||
#
|
||||
# validators for file uploads, etc.
|
||||
|
||||
|
||||
from django.conf import settings
|
||||
|
||||
|
||||
# TODO: can we use the builtin Django validator instead?
|
||||
# see:
|
||||
# https://docs.djangoproject.com/en/4.0/ref/validators/#fileextensionvalidator
|
||||
|
||||
|
||||
def validate_file_extension(value):
|
||||
import os
|
||||
from django.core.exceptions import ValidationError
|
||||
import os
|
||||
ext = os.path.splitext(value.name)[1] # [0] returns path+filename
|
||||
# TODO: we might improve this with more thorough checks of file types
|
||||
# rather than just the extensions.
|
||||
|
Reference in New Issue
Block a user