From bf29e0d3943cf5273bb9146a4332584823f3a33b Mon Sep 17 00:00:00 2001 From: Ross Date: Fri, 12 Mar 2021 08:55:48 +0000 Subject: [PATCH] . --- longs/views.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/longs/views.py b/longs/views.py index a63b372b..50d57252 100755 --- a/longs/views.py +++ b/longs/views.py @@ -993,16 +993,16 @@ def question_json(request, pk): #if not exam.active: # raise Http404("No available exam") - question_json_cache = cache.get("{}_question_json_{}".format("longs", pk)) + path= "{0}longs/questions/{1}.json".format(settings.MEDIA_ROOT, question_id) + url= "{0}{1}/exam/{2}.json".format(settings.MEDIA_URL, self.app_name, pk) + + if os.path.isfile(path) and not exam.recreate_json: if question_json_cache is not None and not question.recreate_json: - #question_json_cache["cached"] = True - return redirect(question_json_cache) + return redirect(url) question_json = question.get_json(pk) - cache.set("{}_question_json_{}".format("longs", pk), question_json, 3600) - question.recreate_json = False question.save()