Skip to content

Fix officers/all response for legacy positions - #177

Closed
kathryntanardy wants to merge 4 commits into
mainfrom
fix_legacy-positions-error
Closed

kathryntanardy wants to merge 4 commits into
mainfrom
fix_legacy-positions-error

Conversation

@kathryntanardy

Copy link
Copy Markdown
Contributor

Close #159

Fix for the /officers/all 500 caused by legacy officer position values such as "elections officer". The Officer response model now treats position as a string, so old database values can be returned without being validated against the current OfficerPositionEnum. Write models still use the enum, so new create/update inputs remain strict.

@jbriones1 jbriones1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with your assessment that we should keep future inserts/updates using the positions we have defined.

Comment thread src/officers/models.py Outdated
Comment thread src/officers/models.py
Comment thread src/officers/models.py Outdated

@jbriones1 jbriones1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I keep waffling on this. Last one, I swear >.<

Comment thread src/officers/models.py Outdated
Comment thread src/officers/models.py Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
position: str

See below for reasoning

@jbriones1

Copy link
Copy Markdown
Contributor

@kathryntanardy I think this issue exposes a deeply rooted issue that we have a chance to address now since we'll be migrating our infrastructure. This means I can re-do our schema and prepare the data so this can be addressed properly. I'm going to pause this issue for now

@jbriones1 jbriones1 closed this Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Endpoint /officers/all on the production database returns 500

2 participants