From 5bbfbb26ec01a23dcd0ee2c37020cfbd9d9e95f8 Mon Sep 17 00:00:00 2001 From: michplunkett <5885605+michplunkett@users.noreply.github.com> Date: Wed, 14 Aug 2024 16:49:38 -0700 Subject: [PATCH] Update commands.py --- OpenOversight/app/commands.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenOversight/app/commands.py b/OpenOversight/app/commands.py index bb2fa3fc9..175da28d2 100644 --- a/OpenOversight/app/commands.py +++ b/OpenOversight/app/commands.py @@ -221,10 +221,10 @@ def update_officer_field(officer_field_name): # If we're expecting a date type, attempt to parse row[field_name] as a # datetime. This normalizes all date formats, ensuring the following # comparison works properly - if type(old_value) is (date, datetime): + if isinstance(old_value, (date, datetime)): try: new_value = parse(row[field_name]) - if type(old_value) is date: + if isinstance(old_value, date): new_value = new_value.date() except Exception as err: msg = (