Second Elections PR#105
Conversation
…k if position is active
|
@gunmack I've added 7 more API endpoints, which handle uploading personal info & registering in elections. This should be everything we need for the elections pages! It now also returns speeches and personal info for a person. There are a reasonable number of special cases, but the important ones are as follows:
You may want to read the code in this PR to see what format the data will be returned as, but I can help clarify as well, so feel free to ask me any questions! |
jbriones1
left a comment
There was a problem hiding this comment.
Some questions and suggestions.
|
-Update: deprecated the update_registration endpoint as no longer required. |
There was a problem hiding this comment.
Pull Request Overview
This PR finalizes the elections backend by implementing election management features including self-registration for candidates and returning speeches from election details endpoints. The changes add comprehensive CRUD operations for elections, nominee registrations, and nominee information management.
Key changes:
- Adds complete test coverage for all election endpoints with both authorized and unauthorized access scenarios
- Updates database schema to support available positions per election and nominee information storage
- Implements full election API with creation, updating, deletion, and candidate registration endpoints
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/integration/test_elections.py | Comprehensive integration tests for all election endpoints |
| src/officers/constants.py | Defines position constants for different election types |
| src/load_test_db.py | Updates test data with nominee info and election positions |
| src/elections/urls.py | Complete election API implementation with registration and nominee info endpoints |
| src/elections/tables.py | Updated database schema with nominee info and application tables |
| src/elections/crud.py | CRUD operations for elections, registrations, and nominee information |
| src/alembic/versions/46d14891e1a9_elections.py | Empty migration file |
| src/alembic/versions/243190df5588_create_election_tables.py | Database migration for election tables |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
jbriones1
left a comment
There was a problem hiding this comment.
A few questions about commented out code, but overall looks good
jbriones1
left a comment
There was a problem hiding this comment.
Only one real change requested (urls.py line 477-481), others are suggestions or comments.
jbriones1
left a comment
There was a problem hiding this comment.
Looks good to me! Thank you for the changes to the endpoint names, it makes the autogenerated Angular services way less verbose.



For #25
Finalize elections backend. Support self-registration & return speeches from
GET elections/by_name/{slug}endpointTODOs: