Merged
Conversation
…nt updates Also fix add non-exist account get InternalError. Fix a logic hole that admin can remove requested/rejected user in manage account page.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enhances error handling and fixes several bugs in the contest management system:
Purpose: Improve user experience by providing detailed error messages when updating contest problem lists and account lists, and fix several bugs related to contest management and challenge list access.
Changes:
- Refactored contest update logic to collect and return detailed error information for each failed operation instead of generic success messages
- Fixed security vulnerability preventing improper removal of Requested/Rejected users from contest account management
- Fixed JavaScript selector bug preventing problem ID field from clearing after operations
- Improved login error messages to distinguish IP restriction vs incorrect credentials
- Fixed challenge list page accessibility when filtering by state=0
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/services/contests.py | Added error_group collection, problem status validation, and improved user/problem list update logic |
| src/handlers/contests/manage/pro.py | Updated to handle error_group from service layer and provide detailed error messages |
| src/handlers/contests/manage/acct.py | Added status validation for user removal and error_group handling |
| src/static/templ/contests/manage/pro.html | Fixed JavaScript selector typo (proID → proId) |
| src/static/templ/contests/manage/acct.html | Changed to display dynamic success/error messages from backend |
| src/services/user.py | Improved login error message for IP restrictions |
| src/handlers/chal.py | Fixed state=0 filtering to allow viewing all challenge states |
| src/tests/unit/services/test_contest.py | Added comprehensive unit tests for contest update error handling |
| src/tests/integrated/contest.py | Added integration tests for new validation rules |
| src/tests/integrated/acct.py | Updated test for improved IP restriction error message |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cea11fd to
2ed891e
Compare
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.
In this PR: