mirror of
https://github.com/RoboSats/robosats.git
synced 2025-02-07 13:59:06 +00:00
Fix bug penalizing a non existing taker
This commit is contained in:
parent
980a385528
commit
a0b38d831f
@ -45,7 +45,6 @@ class Logics():
|
|||||||
queryset = Order.objects.filter(taker=user, status__in=active_order_status)
|
queryset = Order.objects.filter(taker=user, status__in=active_order_status)
|
||||||
if queryset.exists():
|
if queryset.exists():
|
||||||
return False, {'bad_request':'You are already taker of an active order'}
|
return False, {'bad_request':'You are already taker of an active order'}
|
||||||
|
|
||||||
return True, None
|
return True, None
|
||||||
|
|
||||||
def validate_order_size(order):
|
def validate_order_size(order):
|
||||||
@ -208,6 +207,7 @@ class Logics():
|
|||||||
def kick_taker(cls, order):
|
def kick_taker(cls, order):
|
||||||
''' The taker did not lock the taker_bond. Now he has to go'''
|
''' The taker did not lock the taker_bond. Now he has to go'''
|
||||||
# Add a time out to the taker
|
# Add a time out to the taker
|
||||||
|
if order.taker:
|
||||||
profile = order.taker.profile
|
profile = order.taker.profile
|
||||||
profile.penalty_expiration = timezone.now() + timedelta(seconds=PENALTY_TIMEOUT)
|
profile.penalty_expiration = timezone.now() + timedelta(seconds=PENALTY_TIMEOUT)
|
||||||
profile.save()
|
profile.save()
|
||||||
|
Loading…
Reference in New Issue
Block a user