• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

lucyparsons / OpenOversight / 5756308443
89%

Build:
DEFAULT BRANCH: develop
Ran 03 Aug 2023 10:41PM UTC
Jobs 1
Files 86
Run time 3s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

03 Aug 2023 10:36PM UTC coverage: 88.49%. Remained the same
5756308443

push

github

web-flow
Fix adding duplicate officers to incidents (#1006)

## Description of Changes
Merging fix https://github.com/OrcaCollective/OpenOversight/pull/347
upstream.

**Original PR description**:
Only add new officers to incidents.

When a user edits an incident currently, we retrieve the Incident from
the database and append all officers in the form to that Incident. This
led to sqlalchemy trying to insert duplicate rows into the
officer_incidents association table.

As far as I can tell, this was silently ignored by sqlalchemy in the
past and no unexpected rows were created. With the upgrade to sqlalchemy
2.0.19 (https://github.com/OrcaCollective/OpenOversight/pull/344), the
library appears to have started raising exceptions related to this
behavior.

This change checks to see whether an officer already exists in
Incident.officers before adding them so as to not add duplicate
officers.

## Notes for Deployment
N/A

## Screenshots (if appropriate)
N/A

## Tests and linting
 - [x] This branch is up-to-date with the `develop` branch.
 - [x] `pytest` passes on my local development environment.
 - [x] `pre-commit` passes on my local development environment.

7427 of 8393 relevant lines covered (88.49%)

0.88 hits per line

Jobs
ID Job ID Ran Files Coverage
1 5756308443.1 03 Aug 2023 10:41PM UTC 0
88.49
GitHub Action Run
Source Files on build 5756308443
Detailed source file information is not available for this build.
  • Back to Repo
  • Github Actions Build #5756308443
  • cb63dfed on github
  • Prev Build on develop (#5754819670)
  • Next Build on develop (#5756452079)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc