From 26a42fee96bf0a3323f909f5b797ae4b39169c81 Mon Sep 17 00:00:00 2001 From: Lu Bu <37246122+lubusax@users.noreply.github.com> Date: Tue, 30 May 2023 10:25:22 +0200 Subject: [PATCH] [FIX] Handle ValidationError properly --- hr_attendance_rfid/models/hr_employee.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hr_attendance_rfid/models/hr_employee.py b/hr_attendance_rfid/models/hr_employee.py index d2cf82a0..2cde6c2f 100644 --- a/hr_attendance_rfid/models/hr_employee.py +++ b/hr_attendance_rfid/models/hr_employee.py @@ -69,6 +69,6 @@ def register_attendance(self, card_code): res["error_message"] = msg return res except Exception as e: - res["error_message"] = e - _logger.error(e) + res["error_message"] = str(e) + _logger.error(str(e)) return res