From 79a73d645919f7bc5beb8a5167ed3a60a6104fc2 Mon Sep 17 00:00:00 2001 From: Jean-Marie Favreau Date: Fri, 15 Nov 2024 16:38:44 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20probl=C3=A8me=20cl=C3=A9s=20trop=20longue?= =?UTF-8?q?s=20(cache)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/agenda_culturel/models.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/agenda_culturel/models.py b/src/agenda_culturel/models.py index fbc5892..3f4ccdb 100644 --- a/src/agenda_culturel/models.py +++ b/src/agenda_culturel/models.py @@ -10,6 +10,7 @@ from django_ckeditor_5.fields import CKEditor5Field from urllib.parse import urlparse from django.core.cache import cache +import hashlib import urllib.request import os from django.core.files import File @@ -216,6 +217,7 @@ class Tag(models.Model): def get_tag_groups(nb_suggestions=10, exclude=False, include=False, all=False): id_cache = 'all_tags ' + str(exclude) + ' ' + str(include) + ' ' + str(nb_suggestions) + id_cache = hashlib.md5(id_cache.encode("utf8")).hexdigest() result = cache.get(id_cache) if not result: