Skip to content

Commit 231ecb4

Browse files
committed
type fixes
1 parent 836e05a commit 231ecb4

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

ckan/lib/search/index.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def index_package(self,
136136

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

142142
index_fields = RESERVED_FIELDS + list(pkg_dict.keys())

ckan/views/admin.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,9 @@ def purge_all(self):
232232
for action, deleted_entities in zip(actions, entities):
233233

234234
for entity in deleted_entities:
235-
ent_id = entity.id if hasattr(entity, 'id') else entity['id'] # type: ignore
235+
236+
ent_id = entity.id if hasattr(entity, 'id') \
237+
else entity['id'] # type: ignore
236238
logic.get_action(action)(
237239
{u'user': g.user}, {u'id': ent_id}
238240
)

0 commit comments

Comments
 (0)