Skip to content
This repository has been archived by the owner on Aug 2, 2024. It is now read-only.

Commit

Permalink
Added: actions is None check
Browse files Browse the repository at this point in the history
  • Loading branch information
butsyk committed Jul 8, 2020
1 parent ed079e6 commit 23c6a6f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions business_rules/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ async def run(
"""

conditions, actions = rule['conditions'], rule['actions']
if actions is None:
raise InvalidRuleDefinition('Actions are None')

if len(actions) !=1:
raise InvalidRuleDefinition(f'You should specify only one action, '
f'but specified: {len(actions)}')
Expand Down

0 comments on commit 23c6a6f

Please sign in to comment.