-
Notifications
You must be signed in to change notification settings - Fork 25
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
Création de compte candidat: refactoriser la sortie du bloc #5450
Conversation
J'ai hésité sur deux choses :
|
7eadd5b
to
deba229
Compare
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.
get_exit_url
me semble au bon endroit mais en bonus, je verrais bien une fusion de JobSeekerForSenderBaseView
& JobSeekerBaseView
(et oui, CheckNIRForJobSeekerView
pose encore soucis 👀 )
itou/www/job_seekers_views/views.py
Outdated
@@ -363,7 +375,7 @@ def post(self, request, *args, **kwargs): | |||
# TODO(ewen): check_job_seeker_info doesn't use the session yet, | |||
# so we delete the session here. | |||
self.job_seeker_session.delete() | |||
return self.redirect_to_check_infos(self.job_seeker.public_id) | |||
return HttpResponseRedirect(self.get_exit_url(self.job_seeker.public_id)) |
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.
En vrai, on est dans CheckNIRForJobSeekerView
(je t'ai déjà donné mon avis sur cette vue 😜 )
return HttpResponseRedirect(self.get_exit_url(self.job_seeker.public_id)) | |
return HttpResponseRedirect(reverse("job_seekers_views:check_job_seeker_info", kwargs={"company_pk": self.company.pk, "job_seeker_public_id": job_seeker_public_id})) |
comme dans le get
juste au dessus me semble plus clair ;)
Le message va rentrer pour Super ! J'amende et fusionne lundi. |
We introduce a `get_exit_url`, similar to `get_next_url` but for getting the URL of the step *after* the block. Depending on the tunnel, the output is different.
deba229
to
ae272a4
Compare
🤔 Pourquoi ?
Le bloc de recherche/création de compte candidat peut être utilisé dans plusieurs contextes (tunnels) différents :
Une fois qu'un compte est trouvé ou créé, l'utilisateur est redirigé vers une nouvelle page, en fonction du tunnel.
Cette PR est une proposition de refactorisation, pour clarifier la sortie du bloc.
🍰 Comment ?
Une nouvelle méthode,
get_exit_url()
, similaire àget_next_url()
mais pour avoir l'URL de l'étape après le bloc.Elle permet d'identifier les URLs de sortie de bloc.