Skip to content

Commit dcd8fff

Browse files
Fix crash when rollback hook is about to be called (#380)
1 parent c96b3b8 commit dcd8fff

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## [unreleased]
4+
5+
* config: Fixed crash when rollback hook is about to be called.
6+
37
## 5.1.4 - 2022-06-02
48

59
### Fixed

src/dipdup/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1234,7 +1234,7 @@ def per_index_rollback(self) -> bool:
12341234
"""Check if package has `on_index_rollback` hook"""
12351235
new_hook = is_importable(f'{self.package}.hooks.on_index_rollback', 'on_index_rollback')
12361236
old_hook = is_importable(f'{self.package}.hooks.on_rollback', 'on_rollback')
1237-
if new_hook and new_hook:
1237+
if new_hook and old_hook:
12381238
raise ConflictingHooksError('on_rollback', 'on_index_rollback')
12391239
elif not new_hook and not old_hook:
12401240
raise InitializationRequiredError('none of `on_rollback` or `on_index_rollback` hooks found')

0 commit comments

Comments
 (0)