From 13abeaf32afd407c8f888f06a0e037b25eeac74e Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 26 Sep 2025 17:15:56 +0200 Subject: 🐛 treatment from treatment request: copy start/end dates MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- archaeological_finds/views.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/archaeological_finds/views.py b/archaeological_finds/views.py index e370c0a87..d8b5a3c64 100644 --- a/archaeological_finds/views.py +++ b/archaeological_finds/views.py @@ -823,6 +823,15 @@ def treatment_add(request, pks, treatment_file=None): "year": treatment_file.year, "person": in_charge.pk, } + if treatment_file.exhibition_start_date: + dct["start_date"] = treatment_file.exhibition_start_date.strftime("%Y-%m-%d") + elif treatment_file.creation_date: + dct["start_date"] = treatment_file.creation_date.strftime("%Y-%m-%d") + if treatment_file.exhibition_end_date: + dct["end_date"] = treatment_file.exhibition_end_date.strftime("%Y-%m-%d") + elif treatment_file.end_date: + dct["end_date"] = treatment_file.end_date.strftime("%Y-%m-%d") + locas = list( { str(f.container.location.pk) -- cgit v1.2.3