Skip to content

Commit

Permalink
Merge pull request #4805 from open-formulieren/bug/4763-temporary-fil…
Browse files Browse the repository at this point in the history
…e-upload-blocking-submission-deletion

🐛 [#4763] Allow temporary file uploads to be deleted
  • Loading branch information
sergei-maertens authored Oct 31, 2024
2 parents 814eb7c + 9d7de8e commit 22d641b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/openforms/submissions/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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")


Expand Down

0 comments on commit 22d641b

Please sign in to comment.