Checking price change in signal directly

This commit is contained in:
Felipe Martín 2015-08-29 19:44:40 +02:00
parent 15afe52725
commit 17ae987e62
1 changed files with 3 additions and 1 deletions

View File

@ -18,7 +18,9 @@ def save_historical_price(sender, instance, **kwargs):
new_price = kwargs.get('new_price')
if new_price:
new_price = Decimal(new_price)
instance.save_history(old_price, new_price)
if old_price != new_price:
instance.save_history(old_price, new_price)
def post_check_price_change(sender, instance, created, **kwargs):