feat: Add batch user status update endpoint and related models#133
Merged
feat: Add batch user status update endpoint and related models#133
Conversation
Contributor
RansfordGenesis
commented
Mar 31, 2026
- Implemented a new endpoint for batch updating user statuses, accessible only to admins.
- Added BatchStatusUpdateRequest and BatchStatusUpdateResponse models for request and response handling.
- Enhanced user status management in the OrgChartRepository to filter by accepted users.
- Updated user service to handle status changes with email notifications.
- Introduced new coding challenges and weekly meetings models, repositories, and services.
- Created endpoints for managing coding challenges and weekly meetings, including CRUD operations.
- Added health check endpoint to verify database connectivity.
- Updated email sending functionality to support both SMTP and SMTP_SSL.
- Added migration scripts for new database tables and fields related to meetings and challenges.
- Implemented scripts to update user roles and statuses in bulk.
There was a problem hiding this comment.
Pull request overview
Adds admin-only batch user status updates plus new “weekly meetings” and “coding challenges” CRUD APIs, alongside email-delivery improvements and supporting DB models/migrations.
Changes:
- Added meeting/challenge models, repositories, services, API models, and CRUD routes.
- Added admin batch status update endpoint and tightened org-chart visibility to accepted users.
- Improved email sending configuration (STARTTLS vs SMTP_SSL), added a DB health endpoint, and introduced migration/scripts for new tables and bulk updates.
Reviewed changes
Copilot reviewed 30 out of 31 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| utils/mail_service.py | Adds STARTTLS vs SMTP_SSL support and richer SMTP error handling. |
| update_users_status.py | Adds bulk script to move users from TO_CONTACT → ACCEPTED. |
| update_users_role.py | Adds bulk script to set all users’ role_id to 2. |
| services/weekly_meeting_service.py | Service wrapper for weekly meeting repository CRUD. |
| services/user_service.py | Makes status update resilient when email_templates migration hasn’t run. |
| services/skill_service.py | Adds admin-only “skills pool” create/delete operations. |
| services/coding_challenge_service.py | Service wrapper for coding challenge repository CRUD. |
| services/auth_service.py | Adds migration fallback + richer error mapping in forgot-password flow. |
| docker-compose.dev.yml | Switches media env vars from AWS to Cloudinary in dev compose. |
| db/repository/weekly_meetings.py | Implements weekly meeting CRUD and “active meeting” query. |
| db/repository/skills.py | Adds create/get_by_id/delete helpers for pool management. |
| db/repository/org_chart.py | Filters org-chart queries to accepted users only. |
| db/repository/coding_challenges.py | Implements coding challenge CRUD and “latest challenge” query. |
| db/models/weekly_meetings.py | Introduces WeeklyMeeting ORM model. |
| db/models/coding_challenges.py | Introduces CodingChallenge ORM model + ChallengeType enum. |
| db/init.py | Registers new models for import side effects/metadata. |
| app.py | Adds health check endpoint, startup seeding, and new routers + CORS origins. |
| api/routes/weekly_meetings.py | Adds weekly meeting CRUD endpoints. |
| api/routes/users.py | Opens “get subordinates” to accepted users (not admin-only). |
| api/routes/skills.py | Adds admin endpoints to manage shared skills pool. |
| api/routes/profile_page.py | Adds admin batch user status update endpoint + request/response models. |
| api/routes/coding_challenges.py | Adds coding challenge CRUD endpoints. |
| api/routes/announcements.py | Refactors dependencies typing and makes update partial (exclude_unset). |
| api/api_models/weekly_meetings.py | Adds Pydantic models/validation for weekly meetings. |
| api/api_models/coding_challenges.py | Adds Pydantic models/validation for coding challenges. |
| api/api_models/announcements.py | Extends AnnouncementUpdate with image_url. |
| README.md | Updates setup docs, env vars, startup seeding description, and scripts usage. |
| Alembic/versions/e89564e882b1_add_missing_tables.py | Adds migration for email_templates/weekly_meetings/coding_challenges tables. |
| Alembic/versions/c1d2e3f4a5b6_meetings_recurrence_challenges_deadline.py | Adds migration for scheduled_time/recurrence/deadline columns. |
| .env.sample | Refreshes environment variable examples and removes hardcoded secrets. |
Comments suppressed due to low confidence (3)
utils/mail_service.py:1
send_emailis declaredasyncbut uses blockingsmtplibcalls, which will block the event loop under load. Offload the SMTP work to a thread (e.g.,anyio.to_thread.run_sync) or use FastAPIBackgroundTasks/ a task queue so request handling remains non-blocking.
utils/mail_service.py:1send_emailis declaredasyncbut uses blockingsmtplibcalls, which will block the event loop under load. Offload the SMTP work to a thread (e.g.,anyio.to_thread.run_sync) or use FastAPIBackgroundTasks/ a task queue so request handling remains non-blocking.
utils/mail_service.py:1- Returning raw SMTP exception strings to clients (
Email server error: ...,An error occurred: ...) can leak internal server/SMTP details. Prefer returning a generic user-facing error message and log the exception via the app logger (instead ofprint) with appropriate redaction.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Alembic/versions/c1d2e3f4a5b6_meetings_recurrence_challenges_deadline.py
Outdated
Show resolved
Hide resolved
Alembic/versions/c1d2e3f4a5b6_meetings_recurrence_challenges_deadline.py
Show resolved
Hide resolved
TMCreme
approved these changes
Apr 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.