From 36eb56da3192b97c8ce9d41c1256bfb8ed17e5ed Mon Sep 17 00:00:00 2001 From: Matt Jaquiery Date: Tue, 25 Jun 2024 14:27:31 +0100 Subject: [PATCH] fix: storage full notification on create --- backend_django/config/settings_base.py | 2 +- backend_django/galv/views.py | 6 +++++- docs/source/conf.py | 2 +- docs/tags.json | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/backend_django/config/settings_base.py b/backend_django/config/settings_base.py index 07058e3..b5bd101 100644 --- a/backend_django/config/settings_base.py +++ b/backend_django/config/settings_base.py @@ -20,7 +20,7 @@ # Build paths inside the project like this: BASE_DIR / 'subdir'. import os -API_VERSION = "2.1.47" +API_VERSION = "2.1.48" try: USER_ACTIVATION_TOKEN_EXPIRY_S = int(os.environ.get("DJANGO_USER_ACTIVATION_TOKEN_EXPIRY_S")) diff --git a/backend_django/galv/views.py b/backend_django/galv/views.py index 5d9f5c8..6308b15 100644 --- a/backend_django/galv/views.py +++ b/backend_django/galv/views.py @@ -988,7 +988,9 @@ def handle_upload_parquets(file, data, request): partition.parquet_file = upload partition.save() except StorageError as e: - return error_response(f"Error uploading file to storage: {e}") + file.state = FileState.AWAITING_STORAGE + file.save() + return error_response(f"Error uploading file to storage: {e}", status=507) return Response(ParquetPartitionSerializer(partition, context={'request': request}).data) def handle_upload_complete(file, data): @@ -1254,6 +1256,8 @@ def reimport(self, request, pk = None): return error_response('Requested file not found') file.state = FileState.RETRY_IMPORT file.storage_urls = [] + if file.png is not None: + file.png.delete() file.save() for dataset in file.parquet_partitions.all(): dataset.delete() diff --git a/docs/source/conf.py b/docs/source/conf.py index 02622f5..d50ab50 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -11,7 +11,7 @@ project = 'Galv' copyright = '2023, Oxford RSE' author = 'Oxford RSE' -release = '2.1.47' +release = '2.1.48' # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration diff --git a/docs/tags.json b/docs/tags.json index f0423e1..48ca786 100644 --- a/docs/tags.json +++ b/docs/tags.json @@ -1 +1 @@ -["v2.1.47","main"] \ No newline at end of file +["v2.1.48","main"] \ No newline at end of file