-
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 : léger refactoring de gestion de la session #5436
Conversation
2ce805a
to
262dd1d
Compare
262dd1d
to
b3fb316
Compare
itou/templates/job_seekers_views/create_or_update_job_seeker/step_1.html
Outdated
Show resolved
Hide resolved
itou/www/job_seekers_views/views.py
Outdated
@@ -220,27 +220,47 @@ def get(self, request, *args, **kwargs): | |||
return HttpResponseRedirect(reverse(view_name, kwargs={"session_uuid": self.job_seeker_session.name})) | |||
|
|||
|
|||
class JobSeekerBaseView(TemplateView): | |||
class ExpectedJobSeekerKindMixin(TemplateView): |
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.
class ExpectedJobSeekerKindMixin(TemplateView): | |
class ExpectedJobSeekerSessionMixin(TemplateView): |
et on pourra même éventuellement enlever le JobSeeker
dans le futur en renommant self.job_seeker_session
en self.session_namespace
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.
Oui 👍
Un pas de plus vers une généralisation ?
d32d7b4
to
e60c507
Compare
- ExpectedJobSeekerSessionMixin: to get the session and check that it was created to perform the action we're doing - JobSeekerBaseView: now uses this mixin - Update views: also use this mixin, instead of inheriting JobSeekerBaseView
It was facultative for the sake of deployment.
e60c507
to
4659f66
Compare
🤔 Pourquoi ?
Mieux séparer quelle classe fait quoi, dans
job_seekers_views
.🍰 Comment ?
La session est maintenant gérée par
ExpectedJobSeekerSessionMixin
: elle récupère une session et vérifie que la session a bien été créée pour effectuer l'action en cours.Cette mixin est héritée par
JobSeekerBaseView
, qui ajoute la gestion des tunnels (is_gps
,company
, etc).Enfin,
UpdateJobSeekerBaseView
hérite de la mixin et non plus deJobSeekerBaseView
, car ces vues sont indépendantes deis_gps
,company
etc.🚨 À vérifier
🏝️ Comment tester
💻 Captures d'écran