From 9041c922f75bd166bd1780c93b61174a12cc43d8 Mon Sep 17 00:00:00 2001 From: BluemediaGER Date: Sat, 20 Apr 2024 19:36:57 +0200 Subject: [PATCH] Fix transaction user attribute --- app/ocpp_proto/chargepoint.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/ocpp_proto/chargepoint.py b/app/ocpp_proto/chargepoint.py index c529f42..d41b857 100644 --- a/app/ocpp_proto/chargepoint.py +++ b/app/ocpp_proto/chargepoint.py @@ -176,7 +176,7 @@ class ChargePoint(cp): ) if "id_token" in kwargs.keys(): if id_token_info.status == AuthorizationStatusType.accepted: - transaction.user_id = UUID(token_owner_id) + transaction.user_id = token_owner_id db.add(transaction) elif event_type == str(TransactionEventType.updated): transaction = db.get(DbTransaction, transaction_info["transaction_id"]) @@ -202,7 +202,7 @@ class ChargePoint(cp): db.add(db_meter_value) if "id_token" in kwargs.keys(): if id_token_info.status == AuthorizationStatusType.accepted: - transaction.user_id = UUID(token_owner_id) + transaction.user_id = token_owner_id elif event_type == str(TransactionEventType.ended): transaction = db.get(DbTransaction, transaction_info["transaction_id"]) transaction.status = TransactionStatus.ENDED @@ -220,7 +220,7 @@ class ChargePoint(cp): transaction.meter_end = meter_end if "id_token" in kwargs.keys(): if id_token_info.status == AuthorizationStatusType.accepted: - transaction.user_id = UUID(token_owner_id) + transaction.user_id = token_owner_id db.commit() if "id_token" in kwargs.keys():