From 8a66edb155ce76e80c668c6795bc5deff5e43264 Mon Sep 17 00:00:00 2001 From: George Helman Date: Tue, 26 Nov 2024 18:04:57 -0500 Subject: [PATCH] Make except clause more specific --- dear_petition/petition/resources.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dear_petition/petition/resources.py b/dear_petition/petition/resources.py index 367dfde2..f86a8429 100644 --- a/dear_petition/petition/resources.py +++ b/dear_petition/petition/resources.py @@ -299,7 +299,7 @@ def dehydrate_sex(self, record): sex = getattr(record, "sex") try: sex_value = constants.SEX_CHOICES[sex] - except: + except KeyError: sex_value = constants.NOT_AVAILABLE return sex_value