From 9d7de8ea90c77b8afac8785d0d1aa8cd46b0e6bb Mon Sep 17 00:00:00 2001 From: robinvandermolen Date: Thu, 31 Oct 2024 13:32:44 +0100 Subject: [PATCH] :bug: [#4763] Allow temporary file uploads to be deleted --- src/openforms/submissions/admin.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/openforms/submissions/admin.py b/src/openforms/submissions/admin.py index 66bebc6f71..5edb039477 100644 --- a/src/openforms/submissions/admin.py +++ b/src/openforms/submissions/admin.py @@ -22,7 +22,6 @@ from openforms.logging.models import TimelineLogProxy from openforms.payments.models import SubmissionPayment -from ..utils.admin import ReadOnlyAdminMixin from .constants import IMAGE_COMPONENTS, PostSubmissionEvents, RegistrationStatuses from .exports import ExportFileTypes, export_submissions from .models import ( @@ -485,7 +484,7 @@ def get_sendfile_opts(self): @admin.register(TemporaryFileUpload) -class TemporaryFileUploadAdmin(ReadOnlyAdminMixin, PrivateMediaMixin, admin.ModelAdmin): +class TemporaryFileUploadAdmin(PrivateMediaMixin, admin.ModelAdmin): list_display = ( "uuid", "file_name", @@ -519,6 +518,12 @@ class TemporaryFileUploadAdmin(ReadOnlyAdminMixin, PrivateMediaMixin, admin.Mode def file_size(self, obj): return filesizeformat(obj.content.size) + def has_add_permission(self, request): + return False + + def has_change_permission(self, request, obj=None): + return False + file_size.short_description = _("File size")