đ§ [feat] ComplĂ©ter les profils utilisateur incomplets#1386
đ§ [feat] ComplĂ©ter les profils utilisateur incomplets#1386Jeremy-Bojko wants to merge 12 commits intodevelopfrom
Conversation
- Add view and path so one can complete her profile - Make middleware redirect to complete page when detecting an incomplete profile /!\ Needs testing
Co-authored-by: alice-telescoop <alice-telescoop@users.noreply.github.com>
| if not next_page: | ||
| next_page = reverse("home") | ||
|
|
||
| return redirect(next_page) |
Check warning
Code scanning / CodeQL
URL redirection from remote source Medium
This autofix suggestion was applied.
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 8 months ago
To fix the issue, we need to validate the next_page variable before using it in the redirect function. The Django utility function url_has_allowed_host_and_scheme is well-suited for this purpose. It checks whether a URL is safe to redirect to by verifying that the host and scheme are allowed. If the next_page value fails validation, the code should default to redirecting to a safe fallback URL, such as the home page.
Steps to implement the fix:
- Import the
url_has_allowed_host_and_schemefunction fromdjango.utils.http. - Validate the
next_pagevariable usingurl_has_allowed_host_and_scheme. - If
next_pageis invalid, set it to a safe fallback URL (e.g.,reverse("home")). - Use the validated
next_pagein theredirectfunction.
| @@ -448,3 +448,3 @@ | ||
| next_page = request.GET.get("next", None) | ||
| if not next_page: | ||
| if not url_has_allowed_host_and_scheme(next_page, allowed_hosts=None): | ||
| next_page = reverse("home") |
âŠmote source Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
|
Il manque (cochĂ© quand c'est fait en local mais je pas encore push đą)
|
todo proper field
|
Comme l'indique le dernier commit, mĂȘme si j'ai reportĂ© le changement de nom du champ pour l'organisation, il faut mettre le champ dynamique comme sur l'onboarding @Jeremy-Bojko |
|
On veut faire une modale : context_processor pour envoyer une variable pour que le front active la modale. Le formulaire devrait ĂȘtre intĂ©grĂ© avec HTMX |
1 similar comment
|
On veut faire une modale : context_processor pour envoyer une variable pour que le front active la modale. Le formulaire devrait ĂȘtre intĂ©grĂ© avec HTMX |
Il s'agit de :
Décrivez vos changements
Travaux effectués avec Alice Andres
Checklist d'acceptation de revue de code
Demandes
resolves #1365