Fix bug penalizing a non existing taker

This commit is contained in:
Reckless_Satoshi 2022-01-18 10:40:56 -08:00
parent 980a385528
commit a0b38d831f
No known key found for this signature in database
GPG Key ID: 9C4585B561315571

View File

@ -45,7 +45,6 @@ class Logics():
queryset = Order.objects.filter(taker=user, status__in=active_order_status)
if queryset.exists():
return False, {'bad_request':'You are already taker of an active order'}
return True, None
def validate_order_size(order):
@ -208,6 +207,7 @@ class Logics():
def kick_taker(cls, order):
''' The taker did not lock the taker_bond. Now he has to go'''
# Add a time out to the taker
if order.taker:
profile = order.taker.profile
profile.penalty_expiration = timezone.now() + timedelta(seconds=PENALTY_TIMEOUT)
profile.save()