-
Notifications
You must be signed in to change notification settings - Fork 1
Request substitution confirmation pop-up #255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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 adds backend support for a frontend confirmation popup when users attempt to submit duplicate exchange requests. It introduces a replace parameter to the exchange request endpoints that, when set to true, automatically cancels/rejects the user's previous pending request with the same hash before creating the new one. Additionally, it separates hash collision checking between normal and urgent marketplace requests.
Key Changes:
- Added
replaceparameter handling to DirectExchangeView and MarketplaceExchangeView POST methods - Implemented automatic cancellation of old pending exchanges when
replace=true - Fixed hash collision detection to check separately for normal vs urgent marketplace requests
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
| django/university/routes/exchange/DirectExchangeView.py | Adds replace parameter support and logic to cancel previous direct exchanges with the same hash before creating new ones |
| django/university/routes/MarketplaceExchangeView.py | Adds replace parameter support, separates normal/urgent request duplicate checking, and implements helper methods to cancel/reject old marketplace and urgent requests |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description
Backend support for the frontend PR #596. Modifies the exchange request routes to accept the attribute
replace, which, when set to true, allows the server to cancel a previous request with the same hash as the new, preventing the new insertion from failing.Important
When testing this branch, don't forget to also checkout the frontend to the branch
feature/confirmation-popupChanges Made
MarketplaceExchangeViewandDirectExchangeView, to accept thereplaceattribute on the POST method, not verifying hash collisions when set to true, and, instead, cancelling/rejecting the old request