Skip to content

Commit

Permalink
Update commands.py
Browse files Browse the repository at this point in the history
  • Loading branch information
michplunkett committed Aug 14, 2024
1 parent 68e6fdd commit 5bbfbb2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions OpenOversight/app/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = (
Expand Down

0 comments on commit 5bbfbb2

Please sign in to comment.