mirror of
https://github.com/pretix/pretix.git
synced 2026-04-29 00:12:38 +00:00
Fix: display cleaned filename in upload forms (#2788)
This commit is contained in:
committed by
GitHub
parent
79beeebfa6
commit
1a401ec1e9
@@ -48,6 +48,8 @@ from django.utils.timezone import now
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from django_scopes.forms import SafeModelMultipleChoiceField
|
||||
|
||||
from pretix.helpers.hierarkey import clean_filename
|
||||
|
||||
from ...base.forms import I18nModelForm
|
||||
|
||||
# Import for backwards compatibility with okd import paths
|
||||
@@ -127,7 +129,7 @@ class ClearableBasenameFileInput(forms.ClearableFileInput):
|
||||
def __str__(self):
|
||||
if hasattr(self.file, 'display_name'):
|
||||
return self.file.display_name
|
||||
return os.path.basename(self.file.name).split('.', 1)[-1]
|
||||
return clean_filename(os.path.basename(self.file.name))
|
||||
|
||||
@property
|
||||
def url(self):
|
||||
|
||||
Reference in New Issue
Block a user