mirror of
https://github.com/django-helpdesk/django-helpdesk.git
synced 2025-08-14 10:08:28 +02:00
run ruff formatter
This commit is contained in:
@ -14,6 +14,7 @@ from helpdesk import settings as helpdesk_settings
|
||||
def validate_file_extension(value):
|
||||
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.
|
||||
@ -24,7 +25,5 @@ def validate_file_extension(value):
|
||||
if ext.lower() not in helpdesk_settings.HELPDESK_VALID_EXTENSIONS:
|
||||
# TODO: one more check in case it is a file with no extension; we
|
||||
# should always allow that?
|
||||
if not (ext.lower() == '' or ext.lower() == '.'):
|
||||
raise ValidationError(
|
||||
_('Unsupported file extension: ') + ext.lower()
|
||||
)
|
||||
if not (ext.lower() == "" or ext.lower() == "."):
|
||||
raise ValidationError(_("Unsupported file extension: ") + ext.lower())
|
||||
|
Reference in New Issue
Block a user