From 4529f9b8ddceebf0e545e30df45ea0d3b148e814 Mon Sep 17 00:00:00 2001 From: Iacopo Spalletti Date: Thu, 25 Aug 2016 15:31:15 +0200 Subject: [PATCH] Do not cache sites in the admin --- djangocms_blog/admin.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/djangocms_blog/admin.py b/djangocms_blog/admin.py index 1e834bc..5d8a799 100755 --- a/djangocms_blog/admin.py +++ b/djangocms_blog/admin.py @@ -142,12 +142,10 @@ class PostAdmin(PlaceholderAdminMixin, FrontendEditableAdminMixin, :param request: current request :return: boolean or a queryset of available sites """ - if self._sites is None: - try: - self._sites = request.user.get_sites() - except AttributeError: # pragma: no cover - self._sites = Site.objects.none() - return self._sites + try: + return request.user.get_sites() + except AttributeError: # pragma: no cover + return Site.objects.none() def _set_config_defaults(self, request, form, obj=None): form = super(PostAdmin, self)._set_config_defaults(request, form, obj)