lucyparsons / OpenOversight

Police oversight and accountability through public data 👮
https://openoversight.com
GNU General Public License v3.0
240 stars 79 forks source link

Add validation to Incident form #1087

Closed Spraynard closed 10 months ago

Spraynard commented 10 months ago

Fixes issue

Fixes #839

Description of Changes

Adds inline validator to IncidentForm that checks to see if the officer entities linked to the instance are in the same department as the incident.

Notes for Deployment

Screenshots (if appropriate)

Screen Shot 2024-01-11 at 2 25 45 AM

Tests and Linting

Spraynard commented 10 months ago

@michplunkett Sure thing! I'll add in a test when I'm next able. Thanks for looking at this

Spraynard commented 10 months ago

@sea-kelp I honestly feel the same way, that it is technically possible for another department's officer to be involved in an incident! I'll wait to see what other people's thoughts are about what you said before I continue on this!

b-meson commented 10 months ago

Hi all,

I agree with @sea-kelp, sometimes there are incidents that officers take part of that are outside of their jurisdiction but I'm worried that if we allow police to be tagged in incidents outside of their departments we will have unhappy secondary effects.

I wonder if the way to do this properly is to 'untether' incidents from police departments. While you can have an officer and a department linked to an incident, should incidents be "assigned" to a particular PD? (I think not necessary?)

sea-kelp commented 10 months ago

I think that would make sense as long as we are still able to search incidents by involved officer departments (for example, "all incidents that involved a Chicago PD officer and a CBP officer between 2020-01-01 and 2021-01-01").

b-meson commented 10 months ago

@sea-kelp That's what I was thinking as well.

Spraynard commented 10 months ago

Alright I will close this pull request and I will put some context on the issue

b-meson commented 10 months ago

Thanks for the PR @Spraynard and all your work on this!

Just so I understand and your hard work doesn't go unused, is the new plan to move incidents to be more generic (away from a specific PD) and removes the need for the validation check? But in the future, we still want to revisit the validations and tests for "incidents"? Is that right?