Skip to content

Commit

Permalink
Merge pull request #318 from nephila/hotfix/sites
Browse files Browse the repository at this point in the history
Do not cache sites in the admin
  • Loading branch information
yakky authored Aug 25, 2016
2 parents 3b1e2de + 4529f9b commit db60fa2
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions djangocms_blog/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,10 @@ def get_restricted_sites(self, request):
: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)
Expand Down

0 comments on commit db60fa2

Please sign in to comment.