From abc52622d50ebd649630f06277105aa58a9d927a Mon Sep 17 00:00:00 2001 From: Anders Jensen-Urstad Date: Thu, 4 Aug 2022 17:34:43 +0200 Subject: [PATCH] Fix strange 'weakly-referenced object no longer exist' mongoengine error --- libstat/views/reports.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libstat/views/reports.py b/libstat/views/reports.py index 5b865ed..91c6507 100644 --- a/libstat/views/reports.py +++ b/libstat/views/reports.py @@ -1,3 +1,5 @@ +import copy + from pprint import pprint from bibstat import settings from django.urls import reverse @@ -34,7 +36,7 @@ def report(request): ) ) - context = get_report(surveys, sample_year) + context = copy.deepcopy(get_report(surveys, sample_year)) context["previous_url"] = previous_url if len(sigels) == number_of_sigel_choices: