Skip to content

Commit

Permalink
[Fixes GeoNode#8690] Minor fix for geoapps
Browse files Browse the repository at this point in the history
  • Loading branch information
mattiagiupponi committed Feb 3, 2022
1 parent 73220a3 commit 79ae119
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions geonode/base/templatetags/base_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
from geonode.security.utils import get_visible_resources
from collections import OrderedDict, Counter

from geonode.utils import get_geoapps_models

logger = logging.getLogger(__name__)

register = template.Library()
Expand Down Expand Up @@ -513,9 +515,11 @@ def dynamic_metadata_filters(context):
metadata_available = ExtraMetadata.objects.all()

if facet_type != 'all':
resource_type = getattr(FACET_TO_RESOURCE_TYPE, facet_type).value
resource_type = [getattr(FACET_TO_RESOURCE_TYPE, facet_type).value]
if 'geoapp' in resource_type:
resource_type = [''.join(list(x.models)) for x in get_geoapps_models()]
metadata_available = metadata_available\
.filter(resource__polymorphic_ctype__model=resource_type)
.filter(resource__polymorphic_ctype__model__in=resource_type)

if not metadata_available.exists():
return []
Expand Down

0 comments on commit 79ae119

Please sign in to comment.