From 20309244f343d89d53dc2f91c5da39ea710d10b4 Mon Sep 17 00:00:00 2001 From: Luca Date: Mon, 13 May 2024 17:03:50 +0200 Subject: [PATCH] fix(notify): handle KeyboardInterrupt gracefully --- shiftregister/feedback/management/commands/notify.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/shiftregister/feedback/management/commands/notify.py b/shiftregister/feedback/management/commands/notify.py index 6b43982..3080fd3 100644 --- a/shiftregister/feedback/management/commands/notify.py +++ b/shiftregister/feedback/management/commands/notify.py @@ -28,6 +28,12 @@ class Command(BaseCommand): ) def handle(self, *args, **options): + try: + self._handle(*args, **options) + except KeyboardInterrupt: + self.stderr.write() + + def _handle(self, *args, **options): with options["numbers"].open() as f: numbers = json.load(f)