Do not cache sites in the admin

This commit is contained in:
Iacopo Spalletti 2016-08-25 15:31:15 +02:00
parent d584009912
commit 4529f9b8dd
No known key found for this signature in database
GPG key ID: BDCBC2EB289F60C6

View file

@ -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)