Fix error in sites filtering
This commit is contained in:
parent
a6ff1c8665
commit
74eeeb9730
3 changed files with 9 additions and 3 deletions
|
@ -19,6 +19,7 @@ History
|
|||
* Added plugins templateset.
|
||||
* Improved category admin to avoid circular relationships.
|
||||
* Dropped strict dependency on aldryn-search, haystack. Install separately for search support.
|
||||
* Improved admin filtering.
|
||||
|
||||
******************
|
||||
0.8.9 (unreleased)
|
||||
|
|
|
@ -45,8 +45,12 @@ class SiteListFilter(admin.SimpleListFilter):
|
|||
|
||||
def queryset(self, request, queryset):
|
||||
try:
|
||||
return queryset.filter(**self.used_parameters)
|
||||
except ValidationError as e:
|
||||
if 'sites' in self.used_parameters:
|
||||
return queryset.on_site(Site.objects.get(pk=self.used_parameters['sites']))
|
||||
return queryset
|
||||
except Site.DoesNotExist as e: # pragma: no cover
|
||||
raise admin.options.IncorrectLookupParameters(e)
|
||||
except ValidationError as e: # pragma: no cover
|
||||
raise admin.options.IncorrectLookupParameters(e)
|
||||
|
||||
|
||||
|
@ -112,7 +116,7 @@ class PostAdmin(PlaceholderAdminMixin, FrontendEditableAdminMixin,
|
|||
try:
|
||||
from taggit_helpers.admin import TaggitListFilter
|
||||
filters.append(TaggitListFilter)
|
||||
except ImportError:
|
||||
except ImportError: # pragma: no cover
|
||||
try:
|
||||
from taggit_helpers import TaggitListFilter
|
||||
filters.append(TaggitListFilter)
|
||||
|
|
|
@ -11,3 +11,4 @@ wheel
|
|||
pysolr
|
||||
django-parler>=1.6
|
||||
aldryn-search
|
||||
django-taggit-helpers
|
||||
|
|
Loading…
Reference in a new issue