Skip to content

Commit

Permalink
get
Browse files Browse the repository at this point in the history
  • Loading branch information
avdata99 committed May 9, 2024
1 parent 23f3298 commit 3b5eef3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ckanext/scheming/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ def prepare_dataset_blueprint(self, package_type, bp):

def dataset_facets(self, facets_dict, package_type):
schemas = self._expanded_schemas
dataset_fields = schemas[package_type]['dataset_fields']
dataset_fields = schemas.get(package_type, {}).get('dataset_fields')
for field in dataset_fields:
if not field.get('facet_field', False):
continue
Expand All @@ -394,7 +394,8 @@ def before_dataset_index(self, data_dict):
if data_dict['type'] not in schemas:
return data_dict

dataset_fields = schemas[data_dict['type']]['dataset_fields']
package_type = data_dict['type']
dataset_fields = schemas.get(package_type, {}).get('dataset_fields')
for field in dataset_fields:
if field['field_name'] not in data_dict:
continue
Expand Down

0 comments on commit 3b5eef3

Please sign in to comment.