We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Prevent full disk
### Describe the bug
Sometimes the server's storage gets full, because for some reason filepond uploads aren't being deleted. Today this caused the server to crash (because the full server disk broke redis). We should prevent this from happening in multiple ways:

- Make old uploads be deleted. Would be nice to find out why the uploads aren't being deleted already. But we should also (additionally) periodically remove old files from the media volume.
- Maybe limit the volume size such that it getting full does not influence the rest of the server. But docker doesn't really support that nicely. We could make a separate volume for it on the host and bind-mount it I guess.

### How to reproduce
<!-- Steps to reproduce the behaviour -->
1. Upload lots of albums to a docker deployment
2. See the media volume get larger.

### Expected behaviour
Stuff is cleaned up once it's processed and periodically.




--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `website/photos/tasks.py`
Content:
```
1 from django.db import transaction
2 from django.dispatch import Signal
3 
4 from celery import shared_task
5 from django_drf_filepond.models import TemporaryUpload
6 from django_filepond_widget.fields import FilePondFile
7 
8 from photos.models import Album
9 
10 from .services import extract_archive
11 
12 album_uploaded = Signal()
13 
14 
15 @shared_task
16 def process_album_upload(archive_upload_id: str, album_id: int):
17     try:
18         album = Album.objects.get(id=album_id)
19     except Album.DoesNotExist:
20         return
21 
22     archive = TemporaryUpload.objects.get(upload_id=archive_upload_id).file
23     try:
24         with transaction.atomic():
25             # We make the upload atomic separately, so we can keep using the db if it fails.
26             # See https://docs.djangoproject.com/en/4.2/topics/db/transactions/#handling-exceptions-within-postgresql-transactions.
27             extract_archive(album, archive)
28             album.is_processing = False
29             album.save()
30 
31             # Send signal to notify that an album has been uploaded. This is used
32             # by facedetection, and possibly in the future to notify the uploader.
33             album_uploaded.send(sender=None, album=album)
34     finally:
35         if isinstance(archive, FilePondFile):
36             archive.remove()
37
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/website/photos/tasks.py b/website/photos/tasks.py
--- a/website/photos/tasks.py
+++ b/website/photos/tasks.py
@@ -3,7 +3,6 @@
 
 from celery import shared_task
 from django_drf_filepond.models import TemporaryUpload
-from django_filepond_widget.fields import FilePondFile
 
 from photos.models import Album
 
@@ -19,7 +18,8 @@
     except Album.DoesNotExist:
         return
 
-    archive = TemporaryUpload.objects.get(upload_id=archive_upload_id).file
+    upload = TemporaryUpload.objects.get(upload_id=archive_upload_id)
+    archive = upload.file
     try:
         with transaction.atomic():
             # We make the upload atomic separately, so we can keep using the db if it fails.
@@ -32,5 +32,5 @@
             # by facedetection, and possibly in the future to notify the uploader.
             album_uploaded.send(sender=None, album=album)
     finally:
-        if isinstance(archive, FilePondFile):
-            archive.remove()
+        archive.delete()
+        upload.delete()

{"golden_diff": "diff --git a/website/photos/tasks.py b/website/photos/tasks.py\n--- a/website/photos/tasks.py\n+++ b/website/photos/tasks.py\n@@ -3,7 +3,6 @@\n \n from celery import shared_task\n from django_drf_filepond.models import TemporaryUpload\n-from django_filepond_widget.fields import FilePondFile\n \n from photos.models import Album\n \n@@ -19,7 +18,8 @@\n     except Album.DoesNotExist:\n         return\n \n-    archive = TemporaryUpload.objects.get(upload_id=archive_upload_id).file\n+    upload = TemporaryUpload.objects.get(upload_id=archive_upload_id)\n+    archive = upload.file\n     try:\n         with transaction.atomic():\n             # We make the upload atomic separately, so we can keep using the db if it fails.\n@@ -32,5 +32,5 @@\n             # by facedetection, and possibly in the future to notify the uploader.\n             album_uploaded.send(sender=None, album=album)\n     finally:\n-        if isinstance(archive, FilePondFile):\n-            archive.remove()\n+        archive.delete()\n+        upload.delete()\n", "issue": "Prevent full disk\n### Describe the bug\r\nSometimes the server's storage gets full, because for some reason filepond uploads aren't being deleted. Today this caused the server to crash (because the full server disk broke redis). We should prevent this from happening in multiple ways:\r\n\r\n- Make old uploads be deleted. Would be nice to find out why the uploads aren't being deleted already. But we should also (additionally) periodically remove old files from the media volume.\r\n- Maybe limit the volume size such that it getting full does not influence the rest of the server. But docker doesn't really support that nicely. We could make a separate volume for it on the host and bind-mount it I guess.\r\n\r\n### How to reproduce\r\n<!-- Steps to reproduce the behaviour -->\r\n1. Upload lots of albums to a docker deployment\r\n2. See the media volume get larger.\r\n\r\n### Expected behaviour\r\nStuff is cleaned up once it's processed and periodically.\r\n\r\n\r\n\n", "before_files": [{"content": "from django.db import transaction\nfrom django.dispatch import Signal\n\nfrom celery import shared_task\nfrom django_drf_filepond.models import TemporaryUpload\nfrom django_filepond_widget.fields import FilePondFile\n\nfrom photos.models import Album\n\nfrom .services import extract_archive\n\nalbum_uploaded = Signal()\n\n\n@shared_task\ndef process_album_upload(archive_upload_id: str, album_id: int):\n    try:\n        album = Album.objects.get(id=album_id)\n    except Album.DoesNotExist:\n        return\n\n    archive = TemporaryUpload.objects.get(upload_id=archive_upload_id).file\n    try:\n        with transaction.atomic():\n            # We make the upload atomic separately, so we can keep using the db if it fails.\n            # See https://docs.djangoproject.com/en/4.2/topics/db/transactions/#handling-exceptions-within-postgresql-transactions.\n            extract_archive(album, archive)\n            album.is_processing = False\n            album.save()\n\n            # Send signal to notify that an album has been uploaded. This is used\n            # by facedetection, and possibly in the future to notify the uploader.\n            album_uploaded.send(sender=None, album=album)\n    finally:\n        if isinstance(archive, FilePondFile):\n            archive.remove()\n", "path": "website/photos/tasks.py"}], "after_files": [{"content": "from django.db import transaction\nfrom django.dispatch import Signal\n\nfrom celery import shared_task\nfrom django_drf_filepond.models import TemporaryUpload\n\nfrom photos.models import Album\n\nfrom .services import extract_archive\n\nalbum_uploaded = Signal()\n\n\n@shared_task\ndef process_album_upload(archive_upload_id: str, album_id: int):\n    try:\n        album = Album.objects.get(id=album_id)\n    except Album.DoesNotExist:\n        return\n\n    upload = TemporaryUpload.objects.get(upload_id=archive_upload_id)\n    archive = upload.file\n    try:\n        with transaction.atomic():\n            # We make the upload atomic separately, so we can keep using the db if it fails.\n            # See https://docs.djangoproject.com/en/4.2/topics/db/transactions/#handling-exceptions-within-postgresql-transactions.\n            extract_archive(album, archive)\n            album.is_processing = False\n            album.save()\n\n            # Send signal to notify that an album has been uploaded. This is used\n            # by facedetection, and possibly in the future to notify the uploader.\n            album_uploaded.send(sender=None, album=album)\n    finally:\n        archive.delete()\n        upload.delete()\n", "path": "website/photos/tasks.py"}]}