From 630802f108f58daad7477ffc295a0eba295a580d Mon Sep 17 00:00:00 2001 From: Lova ANDRIARIMALALA <43842786+Xpirix@users.noreply.github.com> Date: Wed, 29 May 2024 10:21:50 +0300 Subject: [PATCH] Do not update the modified date of when downloading a resource (#412) --- qgis-app/api/views.py | 2 +- qgis-app/base/views/processing_view.py | 2 +- qgis-app/layerdefinitions/views.py | 2 +- qgis-app/wavefronts/views.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/qgis-app/api/views.py b/qgis-app/api/views.py index 5d392d6f..5b785900 100644 --- a/qgis-app/api/views.py +++ b/qgis-app/api/views.py @@ -139,7 +139,7 @@ def get(self, request, *args, **kwargs): raise Http404 object.increase_download_counter() - object.save() + object.save(update_fields=['download_count']) # zip the resource zipfile = zip_a_file_if_not_zipfile(object.file.file.name) diff --git a/qgis-app/base/views/processing_view.py b/qgis-app/base/views/processing_view.py index 10087884..3b1352ff 100644 --- a/qgis-app/base/views/processing_view.py +++ b/qgis-app/base/views/processing_view.py @@ -478,7 +478,7 @@ def get(self, request, *args, **kwargs): return TemplateResponse(request, self.template_name, context) else: object.increase_download_counter() - object.save() + object.save(update_fields=['download_count']) # zip the resource and license.txt zipfile = zipped_with_license(object.file.file.name, object.name) diff --git a/qgis-app/layerdefinitions/views.py b/qgis-app/layerdefinitions/views.py index 5309e543..ba318fff 100644 --- a/qgis-app/layerdefinitions/views.py +++ b/qgis-app/layerdefinitions/views.py @@ -127,7 +127,7 @@ def get(self, request, *args, **kwargs): return TemplateResponse(request, self.template_name, context) else: object.increase_download_counter() - object.save() + object.save(update_fields=['download_count']) # zip the resource and license.txt zipfile = zipped_with_license( diff --git a/qgis-app/wavefronts/views.py b/qgis-app/wavefronts/views.py index a93458ea..611a0fa7 100644 --- a/qgis-app/wavefronts/views.py +++ b/qgis-app/wavefronts/views.py @@ -126,7 +126,7 @@ def get(self, request, *args, **kwargs): return TemplateResponse(request, self.template_name, context) else: object.increase_download_counter() - object.save() + object.save(update_fields=['download_count']) # zip the 3d files folder and license.txt path, filename = os.path.split(object.file.file.name)