Skip to content

Fix/contest user pro update#234

Merged
tobiichi3227 merged 6 commits intoTFcis:v2.0from
tobiichi3227:fix/contest-user-pro-update
Feb 23, 2026
Merged

Fix/contest user pro update#234
tobiichi3227 merged 6 commits intoTFcis:v2.0from
tobiichi3227:fix/contest-user-pro-update

Conversation

@tobiichi3227
Copy link
Copy Markdown
Collaborator

In this PR:

  • Enhanced the error messages when updating the problem list and account list in a Contest. Instead of showing a generic “Update Successfully” message, the system now displays detailed errors for each individual problem or account that failed to update.
  • Fixed an issue where adding a non-existent account would cause an InternalError.
  • Fixed a vulnerability that allowed Requested/Rejected accounts to be deleted through the account management page.
  • Improved login error messages to clearly distinguish between IP restriction errors and incorrect username/password errors.
  • Fixed an issue where the Challenge List (ChalList) page could not be accessed.
  • Added Unit Tests and Integration Tests to cover the above changes.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

@tobiichi3227 tobiichi3227 force-pushed the fix/contest-user-pro-update branch from cea11fd to 2ed891e Compare February 21, 2026 07:57
@tobiichi3227 tobiichi3227 merged commit 51b59fb into TFcis:v2.0 Feb 23, 2026
3 checks passed
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.

2 participants