Fix bugs, second dispute statement is awaited.

This commit is contained in:
Reckless_Satoshi 2022-02-24 13:59:16 -08:00
parent 3902159b67
commit 67a108e0ac
No known key found for this signature in database
GPG Key ID: 9C4585B561315571
2 changed files with 7 additions and 2 deletions

View File

@ -362,7 +362,7 @@ class Logics:
order.taker_statement = statement
# If both statements are in, move status to wait for dispute resolution
if order.maker_statement not in [None,""] or order.taker_statement not in [None,""]:
if order.maker_statement not in [None,""] and order.taker_statement not in [None,""]:
order.status = Order.Status.WFR
order.expires_at = timezone.now() + timedelta(
seconds=Order.t_to_expire[Order.Status.WFR])

View File

@ -44,7 +44,12 @@ class Telegram():
def welcome(self, user):
lang = user.profile.telegram_lang_code
order = Order.objects.get(maker=user, status=Order.Status.PUB)
# In weird cases the order cannot be found (e.g. it is cancelled)
queryset = Order.objects.filter(maker=user)
order = queryset.last()
print(str(order.id))
if lang == 'es':
text = f'Hola {user.username}, te enviaré un mensaje cuando tu orden con ID {str(order.id)} haya sido tomada.'