run ruff formatter

This commit is contained in:
DavidVadnais
2025-03-22 15:29:19 -10:00
parent f1f3cad2f2
commit 091670179b
96 changed files with 7656 additions and 4972 deletions

View File

@ -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())