From c9e48d1b33d0f5c5652f6545a644c241075b4ab5 Mon Sep 17 00:00:00 2001 From: Hakan Date: Fri, 15 Nov 2024 16:25:41 +0300 Subject: [PATCH] limit export access log to the last access --- CHANGES | 15 ++++++++++----- src/etools_datamart/__init__.py | 2 +- src/unicef_rest_framework/models/export.py | 2 +- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/CHANGES b/CHANGES index 868f3313..639f479b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,11 @@ +4.7.13 +---- +* ExportAccessLog usage has been simplified by keeping the last access as the sole purpose + it to see if an export is in use at all. + 4.7.12 ---- -Formula for SpotCheckFindings.pending_unsupported_amount has been updated as below; +* Formula for SpotCheckFindings.pending_unsupported_amount has been updated as below; = audit_spotcheck.total_amount_of_ineligible_expenditure audit_engagement.additional_supporting_documentation_provided audit_engagement.justification_provided_and_accepted @@ -9,19 +14,19 @@ Formula for SpotCheckFindings.pending_unsupported_amount has been updated as bel 4.7.11 ---- -CI pipline improvements for version tagging. +* CI pipline improvements for version tagging. 4.7.10 ---- -Further improve Celery task failure error report +* Further improve Celery task failure error report 4.7.9 ---- -Make groups parameter name consistent +* Make groups parameter name consistent ---- -Hotfix for export access log to handle non-standard date format +* Hotfix for export access log to handle non-standard date format 4.7.6 ---- diff --git a/src/etools_datamart/__init__.py b/src/etools_datamart/__init__.py index 8a2d0aee..5a1a57cd 100644 --- a/src/etools_datamart/__init__.py +++ b/src/etools_datamart/__init__.py @@ -1,3 +1,3 @@ NAME = "etools-datamart" -VERSION = __version__ = "4.7.12" +VERSION = __version__ = "4.7.13" __author__ = "" diff --git a/src/unicef_rest_framework/models/export.py b/src/unicef_rest_framework/models/export.py index 991aa466..59beff90 100644 --- a/src/unicef_rest_framework/models/export.py +++ b/src/unicef_rest_framework/models/export.py @@ -149,7 +149,7 @@ def log_access(cls, export, username): try: access_log = cls.objects.get(export=export) - access_log.access_history.append(log_entry) + access_log.access_history = [log_entry] access_log.save() except cls.DoesNotExist: cls.objects.create(export=export, access_history=[log_entry])