-
Notifications
You must be signed in to change notification settings - Fork 838
Pre-fill user_code by making use of verification_uri_complete #1658
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: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -99,6 +99,9 @@ def get_success_url(self): | |||||||||
| }, | ||||||||||
| ) | ||||||||||
|
|
||||||||||
| def get_initial(self): | ||||||||||
| return {"user_code": self.request.GET.get("user_code", "")} | ||||||||||
|
||||||||||
| return {"user_code": self.request.GET.get("user_code", "")} | |
| initial = super().get_initial() | |
| initial["user_code"] = self.request.GET.get("user_code", "") | |
| return initial |
Copilot
AI
Mar 12, 2026
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.
This introduces new behavior (query-string-driven prefill) that should be covered by a unit test to prevent regressions (e.g., request with ?user_code=ABCD-EFGH pre-fills the form; request without the param preserves default initial behavior).
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.
Consider clarifying that the substituted
{user_code}should be URL-encoded when constructing the complete URI (especially if deployments customize theuser_codeformat), since this example places it in a query string.