Skip to content

Commit

Permalink
Merge branch 'master' into fix-map-legend
Browse files Browse the repository at this point in the history
  • Loading branch information
giohappy authored Apr 27, 2021
2 parents c44db0f + 10a0dd9 commit e245837
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions geonode/api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ def get_resources_counts(self, options):
counts = list()
if subtypes:
for subtype in subtypes:
counts.append(
subtype.values(options['count_type']).annotate(count=Count(options['count_type'])).first()
counts.extend(
list(subtype.values(options['count_type']).annotate(count=Count(options['count_type'])))
)
else:
counts = list(resources.values(options['count_type']).annotate(count=Count(options['count_type'])))
Expand Down
2 changes: 1 addition & 1 deletion geonode/layers/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1153,7 +1153,7 @@ def validate_input_source(layer, filename, files, gtype=None, action_type='repla
_("The selected Layer does not exists in the catalog."))

gs_layer = gs_layer.resource.attributes
schema_is_compliant = all([x in gs_layer for x in new_schema_fields])
schema_is_compliant = all([x.replace("-", '_') in gs_layer for x in new_schema_fields])

if not schema_is_compliant:
raise Exception(
Expand Down
5 changes: 4 additions & 1 deletion geonode/upload/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
get_store,
set_time_dimension,
create_geoserver_db_featurestore) # mosaic_delete_first_granule
from geonode.base.models import ThesaurusKeyword
from geonode.base.models import HierarchicalKeyword, ThesaurusKeyword
ogr.UseExceptions()

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -905,6 +905,9 @@ def handle_metadata_keywords(self):
tkeyword = []
if len(self.keywords) > 0:
for dkey in self.keywords:
if isinstance(dkey, HierarchicalKeyword):
fkeyword += [dkey.name]
continue
if dkey['type'] == 'place':
continue
thesaurus = dkey['thesaurus']
Expand Down

0 comments on commit e245837

Please sign in to comment.