Skip to content

Commit

Permalink
Update commands.py
Browse files Browse the repository at this point in the history
  • Loading branch information
michplunkett committed Jul 21, 2024
1 parent dfede08 commit 2f6c58e
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 @@ -502,7 +502,7 @@ def bulk_add_officers(filename, no_create, update_by_name, update_static_fields)
for row in csvfile:
department_id = row["department_id"]
if row["department_id"] not in departments:
department = Department.query.filter_by(id=department_id).one_or_none()
department = db.session.get(Department, department_id)
if department:
departments[department_id] = department
else:
Expand Down Expand Up @@ -639,7 +639,7 @@ def add_department(name, short_name, state, unique_internal_identifier):
@with_appcontext
def add_job_title(department_id, job_title, is_sworn_officer, order):
"""Add a rank to a department."""
department = Department.query.filter_by(id=department_id).one_or_none()
department = db.session.get(Department, department_id)
is_sworn = is_sworn_officer == "true"
job = Job(
job_title=job_title,
Expand Down

0 comments on commit 2f6c58e

Please sign in to comment.