From 441bf23b0dbefdf779c721397b67bfd58712d2bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=A4KayJayDee?= Date: Fri, 4 Aug 2023 21:40:03 +0200 Subject: [PATCH] Fix nitro spent count --- src/tasks.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/tasks.py b/src/tasks.py index 12c1aac..6d5eb99 100644 --- a/src/tasks.py +++ b/src/tasks.py @@ -165,13 +165,14 @@ def read_analytics_file(package_status_id, package_id, link, session): 'display_name': 'display_name' in relation_ship and relation_ship['display_name'] or None, }) for payment in user_json['payments']: - payments.append({ - 'id': payment['id'], - 'amount': payment['amount'], - 'currency': payment['currency'], - 'timestamp': get_ts_regular_string_parser(payment['created_at']).timestamp(), - 'description': payment['description'] - }) + if payment['status'] == 1: + payments.append({ + 'id': payment['id'], + 'amount': payment['amount'], + 'currency': payment['currency'], + 'timestamp': get_ts_regular_string_parser(payment['created_at']).timestamp(), + 'description': payment['description'] + }) print(f'User data: {time.time() - start}')