Skip to content

Commit

Permalink
type fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
avdata99 committed Feb 22, 2022
1 parent 836e05a commit 231ecb4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ckan/lib/search/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def index_package(self,

if config.get_value('ckan.search.remove_deleted_packages'):
# delete the package if there is no state, or the state is `deleted`
if (not pkg_dict.get('state') or 'deleted' in pkg_dict.get('state')):
if pkg_dict.get('state', 'deleted') == 'deleted':
return self.delete_package(pkg_dict)

index_fields = RESERVED_FIELDS + list(pkg_dict.keys())
Expand Down
4 changes: 3 additions & 1 deletion ckan/views/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,9 @@ def purge_all(self):
for action, deleted_entities in zip(actions, entities):

for entity in deleted_entities:
ent_id = entity.id if hasattr(entity, 'id') else entity['id'] # type: ignore

ent_id = entity.id if hasattr(entity, 'id') \
else entity['id'] # type: ignore
logic.get_action(action)(
{u'user': g.user}, {u'id': ent_id}
)
Expand Down

0 comments on commit 231ecb4

Please sign in to comment.