Skip to content
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

Merged
merged 3 commits into from
Jan 23, 2025

Conversation

EwenKorr
Copy link
Contributor

@EwenKorr EwenKorr commented Jan 21, 2025

🤔 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 de JobSeekerBaseView, car ces vues sont indépendantes de is_gps, company etc.

🚨 À vérifier

  • Mettre à jour le CHANGELOG_breaking_changes.md ?

🏝️ Comment tester

Les instructions pour reproduire le problème, les profils de test, le parcours spécifique à utiliser, etc. Si vous disposez d'une recette jetable, mettre l'URL pour tester dans cette partie.

💻 Captures d'écran

Sorry, something went wrong.

@EwenKorr EwenKorr added the no-changelog Ne doit pas figurer dans le journal des changements. label Jan 21, 2025
@EwenKorr EwenKorr self-assigned this Jan 21, 2025
@EwenKorr EwenKorr changed the title Création de compte candidat : léger refactoring de la gestion de la session Création de compte candidat : léger refactoring de gestion de la session Jan 21, 2025
@EwenKorr EwenKorr force-pushed the ewen/session-kind-mixin branch 3 times, most recently from 2ce805a to 262dd1d Compare January 21, 2025 10:47
@EwenKorr EwenKorr requested a review from xavfernandez January 21, 2025 10:51
@EwenKorr EwenKorr force-pushed the ewen/session-kind-mixin branch from 262dd1d to b3fb316 Compare January 21, 2025 13:56
@@ -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):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

Copy link
Contributor Author

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 ?

@EwenKorr EwenKorr force-pushed the ewen/session-kind-mixin branch 2 times, most recently from d32d7b4 to e60c507 Compare January 23, 2025 10:09
- 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.
@EwenKorr EwenKorr force-pushed the ewen/session-kind-mixin branch from e60c507 to 4659f66 Compare January 23, 2025 10:29
@EwenKorr EwenKorr enabled auto-merge January 23, 2025 10:30
@EwenKorr EwenKorr added this pull request to the merge queue Jan 23, 2025
Merged via the queue into master with commit c53c7b3 Jan 23, 2025
9 checks passed
@EwenKorr EwenKorr deleted the ewen/session-kind-mixin branch January 23, 2025 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog Ne doit pas figurer dans le journal des changements.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants