Do not cache sites in the admin
This commit is contained in:
parent
d584009912
commit
4529f9b8dd
1 changed files with 4 additions and 6 deletions
|
@ -142,12 +142,10 @@ class PostAdmin(PlaceholderAdminMixin, FrontendEditableAdminMixin,
|
||||||
:param request: current request
|
:param request: current request
|
||||||
:return: boolean or a queryset of available sites
|
:return: boolean or a queryset of available sites
|
||||||
"""
|
"""
|
||||||
if self._sites is None:
|
|
||||||
try:
|
try:
|
||||||
self._sites = request.user.get_sites()
|
return request.user.get_sites()
|
||||||
except AttributeError: # pragma: no cover
|
except AttributeError: # pragma: no cover
|
||||||
self._sites = Site.objects.none()
|
return Site.objects.none()
|
||||||
return self._sites
|
|
||||||
|
|
||||||
def _set_config_defaults(self, request, form, obj=None):
|
def _set_config_defaults(self, request, form, obj=None):
|
||||||
form = super(PostAdmin, self)._set_config_defaults(request, form, obj)
|
form = super(PostAdmin, self)._set_config_defaults(request, form, obj)
|
||||||
|
|
Loading…
Reference in a new issue