From db9ca0ea2bb5f9818fb114074b50ccfc24459114 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Fri, 20 Oct 2023 15:55:50 +0200 Subject: [PATCH] fix: Properly match 0/1 as string --- bin/async_capture.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/bin/async_capture.py b/bin/async_capture.py index 2797e64..dd276c6 100755 --- a/bin/async_capture.py +++ b/bin/async_capture.py @@ -98,12 +98,13 @@ class AsyncCapture(AbstractManager): if 'auto_report' in to_capture: settings = {} - if isinstance(to_capture['auto_report'], int): - # auto_report was a bool in the submission, it can be 1 or 0. 0 means no. - if not to_capture['auto_report']: - continue - elif isinstance(to_capture['auto_report'], str): - settings = json.loads(to_capture['auto_report']) + if isinstance(to_capture['auto_report'], str): + if to_capture['auto_report'].isdigit(): + # auto_report was a bool in the submission, it can be 1 or 0. 0 means no. + if to_capture['auto_report'] == '0': + continue + else: + settings = json.loads(to_capture['auto_report']) elif isinstance(to_capture['auto_report'], dict): settings = to_capture['auto_report']