Skip to content

Commit

Permalink
support calcrule without signals
Browse files Browse the repository at this point in the history
  • Loading branch information
delcroip committed Apr 26, 2024
1 parent e9fbd93 commit b8dc4bf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion calculation/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ def run_calculation_rules(instance, context, user, **kwargs):
result_signal = calculation_rule.signal_calculate_event.send(
sender=instance.__class__.__name__, instance=instance, user=user, context=context, **kwargs
)
if result_signal[0][1]:
if result_signal and len(result_signal) and result_signal[0][1]:
return result_signal

# if no listened calculation rules - return None
return None

Expand Down

0 comments on commit b8dc4bf

Please sign in to comment.