From d9bfc66ac7641d3ad12d581366d3a51039763f27 Mon Sep 17 00:00:00 2001 From: Valentin Ochs Date: Mon, 9 Jan 2023 20:49:51 +0100 Subject: [PATCH] Remove payment info again --- door_pi_control/nfc.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/door_pi_control/nfc.py b/door_pi_control/nfc.py index 4937ae1..3482c61 100644 --- a/door_pi_control/nfc.py +++ b/door_pi_control/nfc.py @@ -37,9 +37,9 @@ class DoorControlNfc(util.Loggable): lines =[ s.strip() for s in open(self._config.valid_tokens, "r").readlines() ] for i, line in enumerate(lines): l = [s.strip() for s in line.split('|')] - if len(l) == 6: + if len(l) == 5: if not l[0].strip().startswith('#'): - token, name, organization, email, valid_thru, paid = l + token, name, organization, email, valid_thru = l try: if len(valid_thru.strip()) > 0: valid_thru = datetime.date.fromisoformat(valid_thru) @@ -56,10 +56,9 @@ class DoorControlNfc(util.Loggable): 'organization': organization, 'email': email, 'valid_thru': valid_thru, - 'paid': paid.strip().lower() == 'yes' } else: - self._logger().warning(f"Skipping line {i} ({line}) since it does not contain exactly 6 data field") + self._logger().warning(f"Skipping line {i} ({line}) since it does not contain exactly 5 data field") except Exception as e: valid = {} self._logger().error(f"Error reading token file. Exception: {e}") @@ -105,10 +104,6 @@ class DoorControlNfc(util.Loggable): authorized = datetime.date.today() <= data['valid_thru'] if not authorized: self._logger().info(f"Expired token: {token} of {data['name']}") - elif not data['paid']: - authorized = datetime.date.today() <= datetime.date(2023, 3, 1) - if not authorized: - self._logger().info(f"Unpaid token: {token} of {data['name']}") else: authorized = True