From ca4e8faa24bb223623fd2748b7b7a75f1cb29875 Mon Sep 17 00:00:00 2001 From: Ewen Corre Date: Thu, 5 Dec 2024 16:27:42 +0100 Subject: [PATCH] job_seekers_views: disconnect jobseeker update views from `apply` The UpdateJobSeeker* views do not inherit from `apply` views anymore. The URL is changed to use the `session_uuid` parameter. --- .../apply/submit/application/base.html | 2 +- .../check_job_seeker_info_for_hire.html | 2 +- itou/www/apply/views/submit_views.py | 38 + itou/www/job_seekers_views/urls.py | 16 +- itou/www/job_seekers_views/views.py | 76 +- .../www/apply/__snapshots__/test_submit.ambr | 1964 ++++++++--------- .../apply/test_process_external_transfer.py | 23 +- tests/www/apply/test_submit.py | 154 +- .../test_submit_from_job_seekers_list.py | 28 +- 9 files changed, 1229 insertions(+), 1074 deletions(-) diff --git a/itou/templates/apply/submit/application/base.html b/itou/templates/apply/submit/application/base.html index 87f403af3b4..509d12172d6 100644 --- a/itou/templates/apply/submit/application/base.html +++ b/itou/templates/apply/submit/application/base.html @@ -38,7 +38,7 @@

{% include 'apply/includes/_submit_title.html' %}

Dernière actualisation du profil : {{ job_seeker.last_checked_at|date }} à {{ job_seeker.last_checked_at|time }} {% if can_view_personal_information and not request.user.is_job_seeker %} - Vérifier le profil + Vérifier le profil {% endif %} {% if new_check_needed %}{% endif %}

diff --git a/itou/templates/job_seekers_views/check_job_seeker_info_for_hire.html b/itou/templates/job_seekers_views/check_job_seeker_info_for_hire.html index f3408b62d88..d86fd4e0ec9 100644 --- a/itou/templates/job_seekers_views/check_job_seeker_info_for_hire.html +++ b/itou/templates/job_seekers_views/check_job_seeker_info_for_hire.html @@ -14,7 +14,7 @@

Informations personnelles - Mettre à jour + Mettre à jour

{% include "apply/includes/profile_infos.html" %} diff --git a/itou/www/apply/views/submit_views.py b/itou/www/apply/views/submit_views.py index 9b6b26b773f..ab285eced5d 100644 --- a/itou/www/apply/views/submit_views.py +++ b/itou/www/apply/views/submit_views.py @@ -212,6 +212,33 @@ def setup(self, request, *args, **kwargs): self.job_seeker, for_company ) + # Init a job_seeker_session to create links to update job seeker. + if self.apply_session.exists() and not self.apply_session.get("job_seeker_session_name"): + job_seeker_session = self.init_job_seeker_session(request) + job_seeker_session.set("job_seeker_pk", self.job_seeker.pk) + self.apply_session.set("job_seeker_session_name", job_seeker_session.name) + + def update_job_seeker_session_config(self, new_config): + job_seeker_session = SessionNamespace(self.request.session, self.apply_session.get("job_seeker_session_name")) + if not job_seeker_session.exists(): + job_seeker_session.init( + { + "config": { + "reset_url": self.get_reset_url(), + }, + "apply": {"company_pk": self.company.pk}, + } + ) + job_seeker_session.set("config", new_config) + + def get_update_job_seeker_url(self): + view_name = ( + "job_seekers_views:update_job_seeker_step_1_for_hire" + if self.hire_process + else "job_seekers_views:update_job_seeker_step_1" + ) + return reverse(view_name, kwargs={"session_uuid": self.apply_session.get("job_seeker_session_name")}) + def get_context_data(self, **kwargs): return super().get_context_data(**kwargs) | { "job_seeker": self.job_seeker, @@ -226,6 +253,7 @@ def get_context_data(self, **kwargs): not self.request.user.is_job_seeker and self.job_seeker.last_checked_at < timezone.now() - JOB_SEEKER_INFOS_CHECK_PERIOD ), + "update_job_seeker_url": self.get_update_job_seeker_url(), } def get_previous_applications_queryset(self): @@ -422,6 +450,16 @@ def setup(self, request, *args, **kwargs): data=request.POST or None, ) + if self.job_seeker: + self.update_job_seeker_session_config( + { + "reset_url": reverse( + "apply:application_jobs", + kwargs={"company_pk": self.company.pk, "job_seeker_public_id": self.job_seeker.public_id}, + ) + } + ) + def get_next_url(self): # dispatching to IAE or GEIQ eligibility path_name = ( diff --git a/itou/www/job_seekers_views/urls.py b/itou/www/job_seekers_views/urls.py index 2f51cb0a681..9a1d1d31345 100644 --- a/itou/www/job_seekers_views/urls.py +++ b/itou/www/job_seekers_views/urls.py @@ -73,25 +73,25 @@ kwargs={"hire_process": True}, ), path( - "/hire/update//1", + "/hire/update/1", views.UpdateJobSeekerStep1View.as_view(), name="update_job_seeker_step_1_for_hire", kwargs={"hire_process": True}, ), path( - "/hire/update//2", + "/hire/update/2", views.UpdateJobSeekerStep2View.as_view(), name="update_job_seeker_step_2_for_hire", kwargs={"hire_process": True}, ), path( - "/hire/update//3", + "/hire/update/3", views.UpdateJobSeekerStep3View.as_view(), name="update_job_seeker_step_3_for_hire", kwargs={"hire_process": True}, ), path( - "/hire/update//end", + "/hire/update/end", views.UpdateJobSeekerStepEndView.as_view(), name="update_job_seeker_step_end_for_hire", kwargs={"hire_process": True}, @@ -110,22 +110,22 @@ ), # Job seeker check/updates path( - "/update//1", + "/update/1", views.UpdateJobSeekerStep1View.as_view(), name="update_job_seeker_step_1", ), path( - "/update//2", + "/update/2", views.UpdateJobSeekerStep2View.as_view(), name="update_job_seeker_step_2", ), path( - "/update//3", + "/update/3", views.UpdateJobSeekerStep3View.as_view(), name="update_job_seeker_step_3", ), path( - "/update//end", + "/update/end", views.UpdateJobSeekerStepEndView.as_view(), name="update_job_seeker_step_end", ), diff --git a/itou/www/job_seekers_views/views.py b/itou/www/job_seekers_views/views.py index ae3add146f1..f9578f4865e 100644 --- a/itou/www/job_seekers_views/views.py +++ b/itou/www/job_seekers_views/views.py @@ -26,9 +26,9 @@ from itou.utils.apis.exceptions import AddressLookupError from itou.utils.emails import redact_email_address from itou.utils.pagination import ItouPaginator -from itou.utils.session import SessionNamespace, SessionNamespaceRequiredMixin +from itou.utils.session import SessionNamespace from itou.utils.urls import get_safe_url -from itou.www.apply.views.submit_views import ApplicationBaseView, ApplyStepBaseView +from itou.www.apply.views.submit_views import ApplicationBaseView from .forms import ( CheckJobSeekerInfoForm, @@ -771,7 +771,7 @@ def get_context_data(self, **kwargs): return super().get_context_data(**kwargs) | {"profile": self.profile, "progress": "80"} -class UpdateJobSeekerBaseView(SessionNamespaceRequiredMixin, ApplyStepBaseView): +class UpdateJobSeekerBaseView(JobSeekerBaseView): def __init__(self): super().__init__() self.job_seeker_session = None @@ -780,14 +780,35 @@ def get_job_seeker_queryset(self): return User.objects.filter(kind=UserKind.JOB_SEEKER) def setup(self, request, *args, **kwargs): - self.job_seeker = get_object_or_404(self.get_job_seeker_queryset(), public_id=kwargs["job_seeker_public_id"]) - self.job_seeker_session = SessionNamespace(request.session, f"job_seeker-{self.job_seeker.public_id}") + super().setup(request, *args, **kwargs) + self.job_seeker = get_object_or_404( + self.get_job_seeker_queryset(), pk=self.job_seeker_session.get("job_seeker_pk") + ) if request.user.is_authenticated and ( request.user.is_job_seeker or not request.user.can_view_personal_information(self.job_seeker) ): # Since the link leading to this process isn't visible to those users, this should never happen raise PermissionDenied("Votre utilisateur n'est pas autorisé à vérifier les informations de ce candidat") - super().setup(request, *args, **kwargs) + + def dispatch(self, request, *args, **kwargs): + if not self.is_gps: + if request.user.is_authenticated: + if self.hire_process and request.user.kind != UserKind.EMPLOYER: + raise PermissionDenied("Seuls les employeurs sont autorisés à déclarer des embauches") + elif self.hire_process and not self.company.has_member(request.user): + raise PermissionDenied("Vous ne pouvez déclarer une embauche que dans votre structure.") + elif request.user.kind not in [ + UserKind.JOB_SEEKER, + UserKind.PRESCRIBER, + UserKind.EMPLOYER, + ]: + raise PermissionDenied("Vous n'êtes pas autorisé à déposer de candidature.") + + if not self.company.has_active_members: + raise PermissionDenied( + "Cet employeur n'est pas inscrit, vous ne pouvez pas déposer de candidatures en ligne." + ) + return super().dispatch(request, *args, **kwargs) def get_context_data(self, **kwargs): return super().get_context_data(**kwargs) | { @@ -797,12 +818,9 @@ def get_context_data(self, **kwargs): "job_seekers_views:update_job_seeker_step_3_for_hire" if self.hire_process else "job_seekers_views:update_job_seeker_step_3", - kwargs={"company_pk": self.company.pk, "job_seeker_public_id": self.job_seeker.public_id}, - ), - "reset_url": reverse( - "apply:application_jobs", - kwargs={"company_pk": self.company.pk, "job_seeker_public_id": self.job_seeker.public_id}, + kwargs={"session_uuid": self.job_seeker_session.name}, ), + "reset_url": self.get_reset_url(), "readonly_form": False, } @@ -810,18 +828,21 @@ def _disable_form(self): for field in self.form: field.field.disabled = True + def get_reset_url(self): + return self.job_seeker_session.get("config").get("reset_url") + def get_back_url(self): view_name = self.previous_hire_url if self.hire_process else self.previous_apply_url return reverse( view_name, - kwargs={"company_pk": self.company.pk, "job_seeker_public_id": self.job_seeker.public_id}, + kwargs={"session_uuid": self.job_seeker_session.name}, ) def get_next_url(self): view_name = self.next_hire_url if self.hire_process else self.next_apply_url return reverse( view_name, - kwargs={"company_pk": self.company.pk, "job_seeker_public_id": self.job_seeker.public_id}, + kwargs={"session_uuid": self.job_seeker_session.name}, ) @@ -845,8 +866,8 @@ def setup(self, request, *args, **kwargs): if not request.user.is_authenticated: # Do nothing, LoginRequiredMixin will raise in dispatch() return - if not self.job_seeker_session.exists(): - self.job_seeker_session.init({"user": {}}) + if not self.job_seeker_session.get("user"): + self.job_seeker_session.set("user", {}) session_nir = self.job_seeker_session.get("profile", {}).get("nir") session_lack_of_nir_reason = self.job_seeker_session.get("profile", {}).get("lack_of_nir_reason") @@ -882,6 +903,9 @@ def post(self, request, *args, **kwargs): return self.render_to_response(self.get_context_data(**kwargs)) + def get_back_url(self): + return self.get_reset_url() + def get_context_data(self, **kwargs): return super().get_context_data(**kwargs) | { "confirmation_needed": False, @@ -894,7 +918,6 @@ def get_context_data(self, **kwargs): class UpdateJobSeekerStep2View(UpdateJobSeekerBaseView): template_name = "job_seekers_views/create_or_update_job_seeker/step_2.html" - required_session_namespaces = ["job_seeker_session"] + UpdateJobSeekerBaseView.required_session_namespaces previous_apply_url = "job_seekers_views:update_job_seeker_step_1" previous_hire_url = "job_seekers_views:update_job_seeker_step_1_for_hire" @@ -907,6 +930,9 @@ def __init__(self): def setup(self, request, *args, **kwargs): super().setup(request, *args, **kwargs) + if not request.user.is_authenticated: + # Do nothing, LoginRequiredMixin will raise in dispatch() + return self.form = CreateOrUpdateJobSeekerStep2Form( instance=self.job_seeker, initial=self.job_seeker_session.get("user", {}), @@ -934,7 +960,6 @@ def get_context_data(self, **kwargs): class UpdateJobSeekerStep3View(UpdateJobSeekerBaseView): template_name = "job_seekers_views/create_or_update_job_seeker/step_3.html" - required_session_namespaces = ["job_seeker_session"] + UpdateJobSeekerBaseView.required_session_namespaces previous_apply_url = "job_seekers_views:update_job_seeker_step_2" previous_hire_url = "job_seekers_views:update_job_seeker_step_2_for_hire" @@ -950,6 +975,9 @@ def get_job_seeker_queryset(self): def setup(self, request, *args, **kwargs): super().setup(request, *args, **kwargs) + if not request.user.is_authenticated: + # Do nothing, LoginRequiredMixin will raise in dispatch() + return session_pole_emploi_id = self.job_seeker_session.get("profile", {}).get("pole_emploi_id") session_lack_of_pole_emploi_id_reason = self.job_seeker_session.get("profile", {}).get( @@ -989,12 +1017,9 @@ def get_context_data(self, **kwargs): class UpdateJobSeekerStepEndView(UpdateJobSeekerBaseView): template_name = "job_seekers_views/create_or_update_job_seeker/step_end.html" - required_session_namespaces = ["job_seeker_session"] + UpdateJobSeekerBaseView.required_session_namespaces previous_apply_url = "job_seekers_views:update_job_seeker_step_3" previous_hire_url = "job_seekers_views:update_job_seeker_step_3_for_hire" - next_apply_url = "apply:application_jobs" - next_hire_url = "job_seekers_views:check_job_seeker_info_for_hire" def __init__(self): super().__init__() @@ -1027,6 +1052,9 @@ def _get_profile_data_from_session(self): def setup(self, request, *args, **kwargs): super().setup(request, *args, **kwargs) + if not request.user.is_authenticated: + # Do nothing, LoginRequiredMixin will raise in dispatch() + return allowed_user_fields_to_update = [] if self.request.user.can_edit_personal_information(self.job_seeker): @@ -1068,14 +1096,18 @@ def post(self, request, *args, **kwargs): messages.error(request, " ".join(e.messages)) url = reverse( "job_seekers_views:update_job_seeker_step_1", - kwargs={"company_pk": self.company.pk, "job_seeker_public_id": self.job_seeker.public_id}, + kwargs={"session_uuid": self.job_seeker_session.name}, ) else: self.profile.save() - self.job_seeker_session.delete() url = self.get_next_url() + self.job_seeker_session.delete() return HttpResponseRedirect(url) + def get_next_url(self): + # In Update views, when finished, we go back to where we were. + return self.job_seeker_session.get("config").get("reset_url") + def get_context_data(self, **kwargs): return super().get_context_data(**kwargs) | {"profile": self.profile, "progress": "80"} diff --git a/tests/www/apply/__snapshots__/test_submit.ambr b/tests/www/apply/__snapshots__/test_submit.ambr index aeca046859b..86d4ee39ffc 100644 --- a/tests/www/apply/__snapshots__/test_submit.ambr +++ b/tests/www/apply/__snapshots__/test_submit.ambr @@ -1054,6 +1054,60 @@ ]), 'sql': 'SAVEPOINT ""', }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_companymembership" U0 + WHERE (U0."company_id" = ("companies_company"."id") + AND U0."is_active") + LIMIT 1) AS "has_active_members" + FROM "companies_company" + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_company"."id" = %s) + LIMIT 21 + ''', + }), dict({ 'origin': list([ 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', @@ -1125,7 +1179,7 @@ FROM "users_user" LEFT OUTER JOIN "users_jobseekerprofile" ON ("users_user"."id" = "users_jobseekerprofile"."user_id") WHERE ("users_user"."kind" = %s - AND "users_user"."public_id" = %s) + AND "users_user"."id" = %s) LIMIT 21 ''', }), @@ -1149,61 +1203,6 @@ LIMIT 1 ''', }), - dict({ - 'origin': list([ - 'UpdateJobSeekerStep1View.setup[www/apply/views/submit_views.py]', - 'UpdateJobSeekerStep1View.setup[utils/session.py]', - 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', - 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', - ]), - 'sql': ''' - SELECT "companies_company"."id", - "companies_company"."address_line_1", - "companies_company"."address_line_2", - "companies_company"."post_code", - "companies_company"."city", - "companies_company"."department", - "companies_company"."coords", - "companies_company"."geocoding_score", - "companies_company"."geocoding_updated_at", - "companies_company"."ban_api_resolved_address", - "companies_company"."insee_city_id", - "companies_company"."name", - "companies_company"."created_at", - "companies_company"."updated_at", - "companies_company"."uid", - "companies_company"."active_members_email_reminder_last_sent_at", - "companies_company"."automatic_geocoding_update", - "companies_company"."siret", - "companies_company"."naf", - "companies_company"."kind", - "companies_company"."brand", - "companies_company"."phone", - "companies_company"."email", - "companies_company"."auth_email", - "companies_company"."website", - "companies_company"."description", - "companies_company"."provided_support", - "companies_company"."source", - "companies_company"."created_by_id", - "companies_company"."block_job_applications", - "companies_company"."job_applications_blocked_at", - "companies_company"."convention_id", - "companies_company"."job_app_score", - "companies_company"."is_searchable", - "companies_company"."rdv_solidarites_id", - EXISTS - (SELECT %s AS "a" - FROM "companies_companymembership" U0 - WHERE (U0."company_id" = ("companies_company"."id") - AND U0."is_active") - LIMIT 1) AS "has_active_members" - FROM "companies_company" - WHERE (NOT ("companies_company"."siret" = %s) - AND "companies_company"."id" = %s) - LIMIT 21 - ''', - }), dict({ 'origin': list([ 'Atomic.__exit__[/django/db/transaction.py]', @@ -1377,6 +1376,60 @@ ]), 'sql': 'SAVEPOINT ""', }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_companymembership" U0 + WHERE (U0."company_id" = ("companies_company"."id") + AND U0."is_active") + LIMIT 1) AS "has_active_members" + FROM "companies_company" + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_company"."id" = %s) + LIMIT 21 + ''', + }), dict({ 'origin': list([ 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', @@ -1417,7 +1470,7 @@ "users_user"."first_login" FROM "users_user" WHERE ("users_user"."kind" = %s - AND "users_user"."public_id" = %s) + AND "users_user"."id" = %s) LIMIT 21 ''', }), @@ -1441,61 +1494,6 @@ LIMIT 1 ''', }), - dict({ - 'origin': list([ - 'UpdateJobSeekerStep2View.setup[www/apply/views/submit_views.py]', - 'UpdateJobSeekerStep2View.setup[utils/session.py]', - 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', - 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', - ]), - 'sql': ''' - SELECT "companies_company"."id", - "companies_company"."address_line_1", - "companies_company"."address_line_2", - "companies_company"."post_code", - "companies_company"."city", - "companies_company"."department", - "companies_company"."coords", - "companies_company"."geocoding_score", - "companies_company"."geocoding_updated_at", - "companies_company"."ban_api_resolved_address", - "companies_company"."insee_city_id", - "companies_company"."name", - "companies_company"."created_at", - "companies_company"."updated_at", - "companies_company"."uid", - "companies_company"."active_members_email_reminder_last_sent_at", - "companies_company"."automatic_geocoding_update", - "companies_company"."siret", - "companies_company"."naf", - "companies_company"."kind", - "companies_company"."brand", - "companies_company"."phone", - "companies_company"."email", - "companies_company"."auth_email", - "companies_company"."website", - "companies_company"."description", - "companies_company"."provided_support", - "companies_company"."source", - "companies_company"."created_by_id", - "companies_company"."block_job_applications", - "companies_company"."job_applications_blocked_at", - "companies_company"."convention_id", - "companies_company"."job_app_score", - "companies_company"."is_searchable", - "companies_company"."rdv_solidarites_id", - EXISTS - (SELECT %s AS "a" - FROM "companies_companymembership" U0 - WHERE (U0."company_id" = ("companies_company"."id") - AND U0."is_active") - LIMIT 1) AS "has_active_members" - FROM "companies_company" - WHERE (NOT ("companies_company"."siret" = %s) - AND "companies_company"."id" = %s) - LIMIT 21 - ''', - }), dict({ 'origin': list([ 'Atomic.__exit__[/django/db/transaction.py]', @@ -1623,6 +1621,60 @@ ]), 'sql': 'SAVEPOINT ""', }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_companymembership" U0 + WHERE (U0."company_id" = ("companies_company"."id") + AND U0."is_active") + LIMIT 1) AS "has_active_members" + FROM "companies_company" + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_company"."id" = %s) + LIMIT 21 + ''', + }), dict({ 'origin': list([ 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', @@ -1694,7 +1746,7 @@ FROM "users_user" LEFT OUTER JOIN "users_jobseekerprofile" ON ("users_user"."id" = "users_jobseekerprofile"."user_id") WHERE ("users_user"."kind" = %s - AND "users_user"."public_id" = %s) + AND "users_user"."id" = %s) LIMIT 21 ''', }), @@ -1718,61 +1770,6 @@ LIMIT 1 ''', }), - dict({ - 'origin': list([ - 'UpdateJobSeekerStep3View.setup[www/apply/views/submit_views.py]', - 'UpdateJobSeekerStep3View.setup[utils/session.py]', - 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', - 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', - ]), - 'sql': ''' - SELECT "companies_company"."id", - "companies_company"."address_line_1", - "companies_company"."address_line_2", - "companies_company"."post_code", - "companies_company"."city", - "companies_company"."department", - "companies_company"."coords", - "companies_company"."geocoding_score", - "companies_company"."geocoding_updated_at", - "companies_company"."ban_api_resolved_address", - "companies_company"."insee_city_id", - "companies_company"."name", - "companies_company"."created_at", - "companies_company"."updated_at", - "companies_company"."uid", - "companies_company"."active_members_email_reminder_last_sent_at", - "companies_company"."automatic_geocoding_update", - "companies_company"."siret", - "companies_company"."naf", - "companies_company"."kind", - "companies_company"."brand", - "companies_company"."phone", - "companies_company"."email", - "companies_company"."auth_email", - "companies_company"."website", - "companies_company"."description", - "companies_company"."provided_support", - "companies_company"."source", - "companies_company"."created_by_id", - "companies_company"."block_job_applications", - "companies_company"."job_applications_blocked_at", - "companies_company"."convention_id", - "companies_company"."job_app_score", - "companies_company"."is_searchable", - "companies_company"."rdv_solidarites_id", - EXISTS - (SELECT %s AS "a" - FROM "companies_companymembership" U0 - WHERE (U0."company_id" = ("companies_company"."id") - AND U0."is_active") - LIMIT 1) AS "has_active_members" - FROM "companies_company" - WHERE (NOT ("companies_company"."siret" = %s) - AND "companies_company"."id" = %s) - LIMIT 21 - ''', - }), dict({ 'origin': list([ 'Atomic.__exit__[/django/db/transaction.py]', @@ -1952,6 +1949,60 @@ ]), 'sql': 'SAVEPOINT ""', }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_companymembership" U0 + WHERE (U0."company_id" = ("companies_company"."id") + AND U0."is_active") + LIMIT 1) AS "has_active_members" + FROM "companies_company" + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_company"."id" = %s) + LIMIT 21 + ''', + }), dict({ 'origin': list([ 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', @@ -2023,62 +2074,7 @@ FROM "users_user" LEFT OUTER JOIN "users_jobseekerprofile" ON ("users_user"."id" = "users_jobseekerprofile"."user_id") WHERE ("users_user"."kind" = %s - AND "users_user"."public_id" = %s) - LIMIT 21 - ''', - }), - dict({ - 'origin': list([ - 'UpdateJobSeekerStep1View.setup[www/apply/views/submit_views.py]', - 'UpdateJobSeekerStep1View.setup[utils/session.py]', - 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', - 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', - ]), - 'sql': ''' - SELECT "companies_company"."id", - "companies_company"."address_line_1", - "companies_company"."address_line_2", - "companies_company"."post_code", - "companies_company"."city", - "companies_company"."department", - "companies_company"."coords", - "companies_company"."geocoding_score", - "companies_company"."geocoding_updated_at", - "companies_company"."ban_api_resolved_address", - "companies_company"."insee_city_id", - "companies_company"."name", - "companies_company"."created_at", - "companies_company"."updated_at", - "companies_company"."uid", - "companies_company"."active_members_email_reminder_last_sent_at", - "companies_company"."automatic_geocoding_update", - "companies_company"."siret", - "companies_company"."naf", - "companies_company"."kind", - "companies_company"."brand", - "companies_company"."phone", - "companies_company"."email", - "companies_company"."auth_email", - "companies_company"."website", - "companies_company"."description", - "companies_company"."provided_support", - "companies_company"."source", - "companies_company"."created_by_id", - "companies_company"."block_job_applications", - "companies_company"."job_applications_blocked_at", - "companies_company"."convention_id", - "companies_company"."job_app_score", - "companies_company"."is_searchable", - "companies_company"."rdv_solidarites_id", - EXISTS - (SELECT %s AS "a" - FROM "companies_companymembership" U0 - WHERE (U0."company_id" = ("companies_company"."id") - AND U0."is_active") - LIMIT 1) AS "has_active_members" - FROM "companies_company" - WHERE (NOT ("companies_company"."siret" = %s) - AND "companies_company"."id" = %s) + AND "users_user"."id" = %s) LIMIT 21 ''', }), @@ -2339,51 +2335,6 @@ 'origin': list([ 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', - ]), - 'sql': ''' - SELECT "users_user"."id", - "users_user"."password", - "users_user"."last_login", - "users_user"."is_superuser", - "users_user"."username", - "users_user"."first_name", - "users_user"."last_name", - "users_user"."is_staff", - "users_user"."is_active", - "users_user"."date_joined", - "users_user"."address_line_1", - "users_user"."address_line_2", - "users_user"."post_code", - "users_user"."city", - "users_user"."department", - "users_user"."coords", - "users_user"."geocoding_score", - "users_user"."geocoding_updated_at", - "users_user"."ban_api_resolved_address", - "users_user"."insee_city_id", - "users_user"."title", - "users_user"."email", - "users_user"."phone", - "users_user"."kind", - "users_user"."identity_provider", - "users_user"."has_completed_welcoming_tour", - "users_user"."created_by_id", - "users_user"."external_data_source_history", - "users_user"."last_checked_at", - "users_user"."public_id", - "users_user"."address_filled_at", - "users_user"."first_login" - FROM "users_user" - WHERE ("users_user"."kind" = %s - AND "users_user"."public_id" = %s) - LIMIT 21 - ''', - }), - dict({ - 'origin': list([ - 'UpdateJobSeekerStep2View.setup[www/apply/views/submit_views.py]', - 'UpdateJobSeekerStep2View.setup[utils/session.py]', - 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', ]), 'sql': ''' @@ -2434,6 +2385,50 @@ LIMIT 21 ''', }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login" + FROM "users_user" + WHERE ("users_user"."kind" = %s + AND "users_user"."id" = %s) + LIMIT 21 + ''', + }), dict({ 'origin': list([ 'Atomic.__exit__[/django/db/transaction.py]', @@ -2641,6 +2636,60 @@ ]), 'sql': 'SAVEPOINT ""', }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_companymembership" U0 + WHERE (U0."company_id" = ("companies_company"."id") + AND U0."is_active") + LIMIT 1) AS "has_active_members" + FROM "companies_company" + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_company"."id" = %s) + LIMIT 21 + ''', + }), dict({ 'origin': list([ 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', @@ -2707,67 +2756,12 @@ "users_jobseekerprofile"."hexa_additional_address", "users_jobseekerprofile"."hexa_post_code", "users_jobseekerprofile"."hexa_commune_id", - "users_jobseekerprofile"."pe_obfuscated_nir", - "users_jobseekerprofile"."pe_last_certification_attempt_at" - FROM "users_user" - LEFT OUTER JOIN "users_jobseekerprofile" ON ("users_user"."id" = "users_jobseekerprofile"."user_id") - WHERE ("users_user"."kind" = %s - AND "users_user"."public_id" = %s) - LIMIT 21 - ''', - }), - dict({ - 'origin': list([ - 'UpdateJobSeekerStep3View.setup[www/apply/views/submit_views.py]', - 'UpdateJobSeekerStep3View.setup[utils/session.py]', - 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', - 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', - ]), - 'sql': ''' - SELECT "companies_company"."id", - "companies_company"."address_line_1", - "companies_company"."address_line_2", - "companies_company"."post_code", - "companies_company"."city", - "companies_company"."department", - "companies_company"."coords", - "companies_company"."geocoding_score", - "companies_company"."geocoding_updated_at", - "companies_company"."ban_api_resolved_address", - "companies_company"."insee_city_id", - "companies_company"."name", - "companies_company"."created_at", - "companies_company"."updated_at", - "companies_company"."uid", - "companies_company"."active_members_email_reminder_last_sent_at", - "companies_company"."automatic_geocoding_update", - "companies_company"."siret", - "companies_company"."naf", - "companies_company"."kind", - "companies_company"."brand", - "companies_company"."phone", - "companies_company"."email", - "companies_company"."auth_email", - "companies_company"."website", - "companies_company"."description", - "companies_company"."provided_support", - "companies_company"."source", - "companies_company"."created_by_id", - "companies_company"."block_job_applications", - "companies_company"."job_applications_blocked_at", - "companies_company"."convention_id", - "companies_company"."job_app_score", - "companies_company"."is_searchable", - "companies_company"."rdv_solidarites_id", - EXISTS - (SELECT %s AS "a" - FROM "companies_companymembership" U0 - WHERE (U0."company_id" = ("companies_company"."id") - AND U0."is_active") - LIMIT 1) AS "has_active_members" - FROM "companies_company" - WHERE (NOT ("companies_company"."siret" = %s) - AND "companies_company"."id" = %s) + "users_jobseekerprofile"."pe_obfuscated_nir", + "users_jobseekerprofile"."pe_last_certification_attempt_at" + FROM "users_user" + LEFT OUTER JOIN "users_jobseekerprofile" ON ("users_user"."id" = "users_jobseekerprofile"."user_id") + WHERE ("users_user"."kind" = %s + AND "users_user"."id" = %s) LIMIT 21 ''', }), @@ -2926,6 +2920,60 @@ ]), 'sql': 'SAVEPOINT ""', }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_companymembership" U0 + WHERE (U0."company_id" = ("companies_company"."id") + AND U0."is_active") + LIMIT 1) AS "has_active_members" + FROM "companies_company" + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_company"."id" = %s) + LIMIT 21 + ''', + }), dict({ 'origin': list([ 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', @@ -2997,7 +3045,7 @@ FROM "users_user" LEFT OUTER JOIN "users_jobseekerprofile" ON ("users_user"."id" = "users_jobseekerprofile"."user_id") WHERE ("users_user"."kind" = %s - AND "users_user"."public_id" = %s) + AND "users_user"."id" = %s) LIMIT 21 ''', }), @@ -3021,61 +3069,6 @@ LIMIT 1 ''', }), - dict({ - 'origin': list([ - 'UpdateJobSeekerStep1View.setup[www/apply/views/submit_views.py]', - 'UpdateJobSeekerStep1View.setup[utils/session.py]', - 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', - 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', - ]), - 'sql': ''' - SELECT "companies_company"."id", - "companies_company"."address_line_1", - "companies_company"."address_line_2", - "companies_company"."post_code", - "companies_company"."city", - "companies_company"."department", - "companies_company"."coords", - "companies_company"."geocoding_score", - "companies_company"."geocoding_updated_at", - "companies_company"."ban_api_resolved_address", - "companies_company"."insee_city_id", - "companies_company"."name", - "companies_company"."created_at", - "companies_company"."updated_at", - "companies_company"."uid", - "companies_company"."active_members_email_reminder_last_sent_at", - "companies_company"."automatic_geocoding_update", - "companies_company"."siret", - "companies_company"."naf", - "companies_company"."kind", - "companies_company"."brand", - "companies_company"."phone", - "companies_company"."email", - "companies_company"."auth_email", - "companies_company"."website", - "companies_company"."description", - "companies_company"."provided_support", - "companies_company"."source", - "companies_company"."created_by_id", - "companies_company"."block_job_applications", - "companies_company"."job_applications_blocked_at", - "companies_company"."convention_id", - "companies_company"."job_app_score", - "companies_company"."is_searchable", - "companies_company"."rdv_solidarites_id", - EXISTS - (SELECT %s AS "a" - FROM "companies_companymembership" U0 - WHERE (U0."company_id" = ("companies_company"."id") - AND U0."is_active") - LIMIT 1) AS "has_active_members" - FROM "companies_company" - WHERE (NOT ("companies_company"."siret" = %s) - AND "companies_company"."id" = %s) - LIMIT 21 - ''', - }), dict({ 'origin': list([ 'Atomic.__exit__[/django/db/transaction.py]', @@ -3249,6 +3242,60 @@ ]), 'sql': 'SAVEPOINT ""', }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_companymembership" U0 + WHERE (U0."company_id" = ("companies_company"."id") + AND U0."is_active") + LIMIT 1) AS "has_active_members" + FROM "companies_company" + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_company"."id" = %s) + LIMIT 21 + ''', + }), dict({ 'origin': list([ 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', @@ -3289,7 +3336,7 @@ "users_user"."first_login" FROM "users_user" WHERE ("users_user"."kind" = %s - AND "users_user"."public_id" = %s) + AND "users_user"."id" = %s) LIMIT 21 ''', }), @@ -3313,61 +3360,6 @@ LIMIT 1 ''', }), - dict({ - 'origin': list([ - 'UpdateJobSeekerStep2View.setup[www/apply/views/submit_views.py]', - 'UpdateJobSeekerStep2View.setup[utils/session.py]', - 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', - 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', - ]), - 'sql': ''' - SELECT "companies_company"."id", - "companies_company"."address_line_1", - "companies_company"."address_line_2", - "companies_company"."post_code", - "companies_company"."city", - "companies_company"."department", - "companies_company"."coords", - "companies_company"."geocoding_score", - "companies_company"."geocoding_updated_at", - "companies_company"."ban_api_resolved_address", - "companies_company"."insee_city_id", - "companies_company"."name", - "companies_company"."created_at", - "companies_company"."updated_at", - "companies_company"."uid", - "companies_company"."active_members_email_reminder_last_sent_at", - "companies_company"."automatic_geocoding_update", - "companies_company"."siret", - "companies_company"."naf", - "companies_company"."kind", - "companies_company"."brand", - "companies_company"."phone", - "companies_company"."email", - "companies_company"."auth_email", - "companies_company"."website", - "companies_company"."description", - "companies_company"."provided_support", - "companies_company"."source", - "companies_company"."created_by_id", - "companies_company"."block_job_applications", - "companies_company"."job_applications_blocked_at", - "companies_company"."convention_id", - "companies_company"."job_app_score", - "companies_company"."is_searchable", - "companies_company"."rdv_solidarites_id", - EXISTS - (SELECT %s AS "a" - FROM "companies_companymembership" U0 - WHERE (U0."company_id" = ("companies_company"."id") - AND U0."is_active") - LIMIT 1) AS "has_active_members" - FROM "companies_company" - WHERE (NOT ("companies_company"."siret" = %s) - AND "companies_company"."id" = %s) - LIMIT 21 - ''', - }), dict({ 'origin': list([ 'Atomic.__exit__[/django/db/transaction.py]', @@ -3489,12 +3481,66 @@ ORDER BY "prescribers_prescribermembership"."created_at" ASC ''', }), - dict({ - 'origin': list([ - 'Atomic.__enter__[/django/db/transaction.py]', - ]), - 'sql': 'SAVEPOINT ""', - }), + dict({ + 'origin': list([ + 'Atomic.__enter__[/django/db/transaction.py]', + ]), + 'sql': 'SAVEPOINT ""', + }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_companymembership" U0 + WHERE (U0."company_id" = ("companies_company"."id") + AND U0."is_active") + LIMIT 1) AS "has_active_members" + FROM "companies_company" + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_company"."id" = %s) + LIMIT 21 + ''', + }), dict({ 'origin': list([ 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', @@ -3566,7 +3612,7 @@ FROM "users_user" LEFT OUTER JOIN "users_jobseekerprofile" ON ("users_user"."id" = "users_jobseekerprofile"."user_id") WHERE ("users_user"."kind" = %s - AND "users_user"."public_id" = %s) + AND "users_user"."id" = %s) LIMIT 21 ''', }), @@ -3590,61 +3636,6 @@ LIMIT 1 ''', }), - dict({ - 'origin': list([ - 'UpdateJobSeekerStep3View.setup[www/apply/views/submit_views.py]', - 'UpdateJobSeekerStep3View.setup[utils/session.py]', - 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', - 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', - ]), - 'sql': ''' - SELECT "companies_company"."id", - "companies_company"."address_line_1", - "companies_company"."address_line_2", - "companies_company"."post_code", - "companies_company"."city", - "companies_company"."department", - "companies_company"."coords", - "companies_company"."geocoding_score", - "companies_company"."geocoding_updated_at", - "companies_company"."ban_api_resolved_address", - "companies_company"."insee_city_id", - "companies_company"."name", - "companies_company"."created_at", - "companies_company"."updated_at", - "companies_company"."uid", - "companies_company"."active_members_email_reminder_last_sent_at", - "companies_company"."automatic_geocoding_update", - "companies_company"."siret", - "companies_company"."naf", - "companies_company"."kind", - "companies_company"."brand", - "companies_company"."phone", - "companies_company"."email", - "companies_company"."auth_email", - "companies_company"."website", - "companies_company"."description", - "companies_company"."provided_support", - "companies_company"."source", - "companies_company"."created_by_id", - "companies_company"."block_job_applications", - "companies_company"."job_applications_blocked_at", - "companies_company"."convention_id", - "companies_company"."job_app_score", - "companies_company"."is_searchable", - "companies_company"."rdv_solidarites_id", - EXISTS - (SELECT %s AS "a" - FROM "companies_companymembership" U0 - WHERE (U0."company_id" = ("companies_company"."id") - AND U0."is_active") - LIMIT 1) AS "has_active_members" - FROM "companies_company" - WHERE (NOT ("companies_company"."siret" = %s) - AND "companies_company"."id" = %s) - LIMIT 21 - ''', - }), dict({ 'origin': list([ 'Atomic.__exit__[/django/db/transaction.py]', @@ -3824,6 +3815,60 @@ ]), 'sql': 'SAVEPOINT ""', }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_companymembership" U0 + WHERE (U0."company_id" = ("companies_company"."id") + AND U0."is_active") + LIMIT 1) AS "has_active_members" + FROM "companies_company" + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_company"."id" = %s) + LIMIT 21 + ''', + }), dict({ 'origin': list([ 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', @@ -3895,62 +3940,7 @@ FROM "users_user" LEFT OUTER JOIN "users_jobseekerprofile" ON ("users_user"."id" = "users_jobseekerprofile"."user_id") WHERE ("users_user"."kind" = %s - AND "users_user"."public_id" = %s) - LIMIT 21 - ''', - }), - dict({ - 'origin': list([ - 'UpdateJobSeekerStep1View.setup[www/apply/views/submit_views.py]', - 'UpdateJobSeekerStep1View.setup[utils/session.py]', - 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', - 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', - ]), - 'sql': ''' - SELECT "companies_company"."id", - "companies_company"."address_line_1", - "companies_company"."address_line_2", - "companies_company"."post_code", - "companies_company"."city", - "companies_company"."department", - "companies_company"."coords", - "companies_company"."geocoding_score", - "companies_company"."geocoding_updated_at", - "companies_company"."ban_api_resolved_address", - "companies_company"."insee_city_id", - "companies_company"."name", - "companies_company"."created_at", - "companies_company"."updated_at", - "companies_company"."uid", - "companies_company"."active_members_email_reminder_last_sent_at", - "companies_company"."automatic_geocoding_update", - "companies_company"."siret", - "companies_company"."naf", - "companies_company"."kind", - "companies_company"."brand", - "companies_company"."phone", - "companies_company"."email", - "companies_company"."auth_email", - "companies_company"."website", - "companies_company"."description", - "companies_company"."provided_support", - "companies_company"."source", - "companies_company"."created_by_id", - "companies_company"."block_job_applications", - "companies_company"."job_applications_blocked_at", - "companies_company"."convention_id", - "companies_company"."job_app_score", - "companies_company"."is_searchable", - "companies_company"."rdv_solidarites_id", - EXISTS - (SELECT %s AS "a" - FROM "companies_companymembership" U0 - WHERE (U0."company_id" = ("companies_company"."id") - AND U0."is_active") - LIMIT 1) AS "has_active_members" - FROM "companies_company" - WHERE (NOT ("companies_company"."siret" = %s) - AND "companies_company"."id" = %s) + AND "users_user"."id" = %s) LIMIT 21 ''', }), @@ -4211,51 +4201,6 @@ 'origin': list([ 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', - ]), - 'sql': ''' - SELECT "users_user"."id", - "users_user"."password", - "users_user"."last_login", - "users_user"."is_superuser", - "users_user"."username", - "users_user"."first_name", - "users_user"."last_name", - "users_user"."is_staff", - "users_user"."is_active", - "users_user"."date_joined", - "users_user"."address_line_1", - "users_user"."address_line_2", - "users_user"."post_code", - "users_user"."city", - "users_user"."department", - "users_user"."coords", - "users_user"."geocoding_score", - "users_user"."geocoding_updated_at", - "users_user"."ban_api_resolved_address", - "users_user"."insee_city_id", - "users_user"."title", - "users_user"."email", - "users_user"."phone", - "users_user"."kind", - "users_user"."identity_provider", - "users_user"."has_completed_welcoming_tour", - "users_user"."created_by_id", - "users_user"."external_data_source_history", - "users_user"."last_checked_at", - "users_user"."public_id", - "users_user"."address_filled_at", - "users_user"."first_login" - FROM "users_user" - WHERE ("users_user"."kind" = %s - AND "users_user"."public_id" = %s) - LIMIT 21 - ''', - }), - dict({ - 'origin': list([ - 'UpdateJobSeekerStep2View.setup[www/apply/views/submit_views.py]', - 'UpdateJobSeekerStep2View.setup[utils/session.py]', - 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', ]), 'sql': ''' @@ -4306,6 +4251,50 @@ LIMIT 21 ''', }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login" + FROM "users_user" + WHERE ("users_user"."kind" = %s + AND "users_user"."id" = %s) + LIMIT 21 + ''', + }), dict({ 'origin': list([ 'Atomic.__exit__[/django/db/transaction.py]', @@ -4513,6 +4502,60 @@ ]), 'sql': 'SAVEPOINT ""', }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_companymembership" U0 + WHERE (U0."company_id" = ("companies_company"."id") + AND U0."is_active") + LIMIT 1) AS "has_active_members" + FROM "companies_company" + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_company"."id" = %s) + LIMIT 21 + ''', + }), dict({ 'origin': list([ 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', @@ -4584,62 +4627,7 @@ FROM "users_user" LEFT OUTER JOIN "users_jobseekerprofile" ON ("users_user"."id" = "users_jobseekerprofile"."user_id") WHERE ("users_user"."kind" = %s - AND "users_user"."public_id" = %s) - LIMIT 21 - ''', - }), - dict({ - 'origin': list([ - 'UpdateJobSeekerStep3View.setup[www/apply/views/submit_views.py]', - 'UpdateJobSeekerStep3View.setup[utils/session.py]', - 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', - 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', - ]), - 'sql': ''' - SELECT "companies_company"."id", - "companies_company"."address_line_1", - "companies_company"."address_line_2", - "companies_company"."post_code", - "companies_company"."city", - "companies_company"."department", - "companies_company"."coords", - "companies_company"."geocoding_score", - "companies_company"."geocoding_updated_at", - "companies_company"."ban_api_resolved_address", - "companies_company"."insee_city_id", - "companies_company"."name", - "companies_company"."created_at", - "companies_company"."updated_at", - "companies_company"."uid", - "companies_company"."active_members_email_reminder_last_sent_at", - "companies_company"."automatic_geocoding_update", - "companies_company"."siret", - "companies_company"."naf", - "companies_company"."kind", - "companies_company"."brand", - "companies_company"."phone", - "companies_company"."email", - "companies_company"."auth_email", - "companies_company"."website", - "companies_company"."description", - "companies_company"."provided_support", - "companies_company"."source", - "companies_company"."created_by_id", - "companies_company"."block_job_applications", - "companies_company"."job_applications_blocked_at", - "companies_company"."convention_id", - "companies_company"."job_app_score", - "companies_company"."is_searchable", - "companies_company"."rdv_solidarites_id", - EXISTS - (SELECT %s AS "a" - FROM "companies_companymembership" U0 - WHERE (U0."company_id" = ("companies_company"."id") - AND U0."is_active") - LIMIT 1) AS "has_active_members" - FROM "companies_company" - WHERE (NOT ("companies_company"."siret" = %s) - AND "companies_company"."id" = %s) + AND "users_user"."id" = %s) LIMIT 21 ''', }), @@ -4850,6 +4838,60 @@ ]), 'sql': 'SAVEPOINT ""', }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_companymembership" U0 + WHERE (U0."company_id" = ("companies_company"."id") + AND U0."is_active") + LIMIT 1) AS "has_active_members" + FROM "companies_company" + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_company"."id" = %s) + LIMIT 21 + ''', + }), dict({ 'origin': list([ 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', @@ -4911,79 +4953,24 @@ "users_jobseekerprofile"."hexa_lane_number", "users_jobseekerprofile"."hexa_std_extension", "users_jobseekerprofile"."hexa_non_std_extension", - "users_jobseekerprofile"."hexa_lane_type", - "users_jobseekerprofile"."hexa_lane_name", - "users_jobseekerprofile"."hexa_additional_address", - "users_jobseekerprofile"."hexa_post_code", - "users_jobseekerprofile"."hexa_commune_id", - "users_jobseekerprofile"."pe_obfuscated_nir", - "users_jobseekerprofile"."pe_last_certification_attempt_at" - FROM "users_user" - LEFT OUTER JOIN "users_jobseekerprofile" ON ("users_user"."id" = "users_jobseekerprofile"."user_id") - WHERE ("users_user"."kind" = %s - AND "users_user"."public_id" = %s) - LIMIT 21 - ''', - }), - dict({ - 'origin': list([ - 'UpdateJobSeekerStep1View.setup[www/apply/views/submit_views.py]', - 'UpdateJobSeekerStep1View.setup[utils/session.py]', - 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', - 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', - ]), - 'sql': ''' - SELECT "companies_company"."id", - "companies_company"."address_line_1", - "companies_company"."address_line_2", - "companies_company"."post_code", - "companies_company"."city", - "companies_company"."department", - "companies_company"."coords", - "companies_company"."geocoding_score", - "companies_company"."geocoding_updated_at", - "companies_company"."ban_api_resolved_address", - "companies_company"."insee_city_id", - "companies_company"."name", - "companies_company"."created_at", - "companies_company"."updated_at", - "companies_company"."uid", - "companies_company"."active_members_email_reminder_last_sent_at", - "companies_company"."automatic_geocoding_update", - "companies_company"."siret", - "companies_company"."naf", - "companies_company"."kind", - "companies_company"."brand", - "companies_company"."phone", - "companies_company"."email", - "companies_company"."auth_email", - "companies_company"."website", - "companies_company"."description", - "companies_company"."provided_support", - "companies_company"."source", - "companies_company"."created_by_id", - "companies_company"."block_job_applications", - "companies_company"."job_applications_blocked_at", - "companies_company"."convention_id", - "companies_company"."job_app_score", - "companies_company"."is_searchable", - "companies_company"."rdv_solidarites_id", - EXISTS - (SELECT %s AS "a" - FROM "companies_companymembership" U0 - WHERE (U0."company_id" = ("companies_company"."id") - AND U0."is_active") - LIMIT 1) AS "has_active_members" - FROM "companies_company" - WHERE (NOT ("companies_company"."siret" = %s) - AND "companies_company"."id" = %s) + "users_jobseekerprofile"."hexa_lane_type", + "users_jobseekerprofile"."hexa_lane_name", + "users_jobseekerprofile"."hexa_additional_address", + "users_jobseekerprofile"."hexa_post_code", + "users_jobseekerprofile"."hexa_commune_id", + "users_jobseekerprofile"."pe_obfuscated_nir", + "users_jobseekerprofile"."pe_last_certification_attempt_at" + FROM "users_user" + LEFT OUTER JOIN "users_jobseekerprofile" ON ("users_user"."id" = "users_jobseekerprofile"."user_id") + WHERE ("users_user"."kind" = %s + AND "users_user"."id" = %s) LIMIT 21 ''', }), dict({ 'origin': list([ 'Company.has_member[common_apps/organizations/models.py]', - 'UpdateJobSeekerStep1View.dispatch[www/apply/views/submit_views.py]', + 'UpdateJobSeekerStep1View.dispatch[www/job_seekers_views/views.py]', ]), 'sql': ''' SELECT %s AS "a" @@ -5257,51 +5244,6 @@ 'origin': list([ 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', - ]), - 'sql': ''' - SELECT "users_user"."id", - "users_user"."password", - "users_user"."last_login", - "users_user"."is_superuser", - "users_user"."username", - "users_user"."first_name", - "users_user"."last_name", - "users_user"."is_staff", - "users_user"."is_active", - "users_user"."date_joined", - "users_user"."address_line_1", - "users_user"."address_line_2", - "users_user"."post_code", - "users_user"."city", - "users_user"."department", - "users_user"."coords", - "users_user"."geocoding_score", - "users_user"."geocoding_updated_at", - "users_user"."ban_api_resolved_address", - "users_user"."insee_city_id", - "users_user"."title", - "users_user"."email", - "users_user"."phone", - "users_user"."kind", - "users_user"."identity_provider", - "users_user"."has_completed_welcoming_tour", - "users_user"."created_by_id", - "users_user"."external_data_source_history", - "users_user"."last_checked_at", - "users_user"."public_id", - "users_user"."address_filled_at", - "users_user"."first_login" - FROM "users_user" - WHERE ("users_user"."kind" = %s - AND "users_user"."public_id" = %s) - LIMIT 21 - ''', - }), - dict({ - 'origin': list([ - 'UpdateJobSeekerStep2View.setup[www/apply/views/submit_views.py]', - 'UpdateJobSeekerStep2View.setup[utils/session.py]', - 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', ]), 'sql': ''' @@ -5352,10 +5294,54 @@ LIMIT 21 ''', }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login" + FROM "users_user" + WHERE ("users_user"."kind" = %s + AND "users_user"."id" = %s) + LIMIT 21 + ''', + }), dict({ 'origin': list([ 'Company.has_member[common_apps/organizations/models.py]', - 'UpdateJobSeekerStep2View.dispatch[www/apply/views/submit_views.py]', + 'UpdateJobSeekerStep2View.dispatch[www/job_seekers_views/views.py]', ]), 'sql': ''' SELECT %s AS "a" @@ -5579,6 +5565,60 @@ ]), 'sql': 'SAVEPOINT ""', }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_companymembership" U0 + WHERE (U0."company_id" = ("companies_company"."id") + AND U0."is_active") + LIMIT 1) AS "has_active_members" + FROM "companies_company" + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_company"."id" = %s) + LIMIT 21 + ''', + }), dict({ 'origin': list([ 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', @@ -5650,69 +5690,14 @@ FROM "users_user" LEFT OUTER JOIN "users_jobseekerprofile" ON ("users_user"."id" = "users_jobseekerprofile"."user_id") WHERE ("users_user"."kind" = %s - AND "users_user"."public_id" = %s) - LIMIT 21 - ''', - }), - dict({ - 'origin': list([ - 'UpdateJobSeekerStep3View.setup[www/apply/views/submit_views.py]', - 'UpdateJobSeekerStep3View.setup[utils/session.py]', - 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', - 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', - ]), - 'sql': ''' - SELECT "companies_company"."id", - "companies_company"."address_line_1", - "companies_company"."address_line_2", - "companies_company"."post_code", - "companies_company"."city", - "companies_company"."department", - "companies_company"."coords", - "companies_company"."geocoding_score", - "companies_company"."geocoding_updated_at", - "companies_company"."ban_api_resolved_address", - "companies_company"."insee_city_id", - "companies_company"."name", - "companies_company"."created_at", - "companies_company"."updated_at", - "companies_company"."uid", - "companies_company"."active_members_email_reminder_last_sent_at", - "companies_company"."automatic_geocoding_update", - "companies_company"."siret", - "companies_company"."naf", - "companies_company"."kind", - "companies_company"."brand", - "companies_company"."phone", - "companies_company"."email", - "companies_company"."auth_email", - "companies_company"."website", - "companies_company"."description", - "companies_company"."provided_support", - "companies_company"."source", - "companies_company"."created_by_id", - "companies_company"."block_job_applications", - "companies_company"."job_applications_blocked_at", - "companies_company"."convention_id", - "companies_company"."job_app_score", - "companies_company"."is_searchable", - "companies_company"."rdv_solidarites_id", - EXISTS - (SELECT %s AS "a" - FROM "companies_companymembership" U0 - WHERE (U0."company_id" = ("companies_company"."id") - AND U0."is_active") - LIMIT 1) AS "has_active_members" - FROM "companies_company" - WHERE (NOT ("companies_company"."siret" = %s) - AND "companies_company"."id" = %s) + AND "users_user"."id" = %s) LIMIT 21 ''', }), dict({ 'origin': list([ 'Company.has_member[common_apps/organizations/models.py]', - 'UpdateJobSeekerStep3View.dispatch[www/apply/views/submit_views.py]', + 'UpdateJobSeekerStep3View.dispatch[www/job_seekers_views/views.py]', ]), 'sql': ''' SELECT %s AS "a" @@ -5936,6 +5921,60 @@ ]), 'sql': 'SAVEPOINT ""', }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_companymembership" U0 + WHERE (U0."company_id" = ("companies_company"."id") + AND U0."is_active") + LIMIT 1) AS "has_active_members" + FROM "companies_company" + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_company"."id" = %s) + LIMIT 21 + ''', + }), dict({ 'origin': list([ 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', @@ -6007,69 +6046,14 @@ FROM "users_user" LEFT OUTER JOIN "users_jobseekerprofile" ON ("users_user"."id" = "users_jobseekerprofile"."user_id") WHERE ("users_user"."kind" = %s - AND "users_user"."public_id" = %s) - LIMIT 21 - ''', - }), - dict({ - 'origin': list([ - 'UpdateJobSeekerStep1View.setup[www/apply/views/submit_views.py]', - 'UpdateJobSeekerStep1View.setup[utils/session.py]', - 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', - 'UpdateJobSeekerStep1View.setup[www/job_seekers_views/views.py]', - ]), - 'sql': ''' - SELECT "companies_company"."id", - "companies_company"."address_line_1", - "companies_company"."address_line_2", - "companies_company"."post_code", - "companies_company"."city", - "companies_company"."department", - "companies_company"."coords", - "companies_company"."geocoding_score", - "companies_company"."geocoding_updated_at", - "companies_company"."ban_api_resolved_address", - "companies_company"."insee_city_id", - "companies_company"."name", - "companies_company"."created_at", - "companies_company"."updated_at", - "companies_company"."uid", - "companies_company"."active_members_email_reminder_last_sent_at", - "companies_company"."automatic_geocoding_update", - "companies_company"."siret", - "companies_company"."naf", - "companies_company"."kind", - "companies_company"."brand", - "companies_company"."phone", - "companies_company"."email", - "companies_company"."auth_email", - "companies_company"."website", - "companies_company"."description", - "companies_company"."provided_support", - "companies_company"."source", - "companies_company"."created_by_id", - "companies_company"."block_job_applications", - "companies_company"."job_applications_blocked_at", - "companies_company"."convention_id", - "companies_company"."job_app_score", - "companies_company"."is_searchable", - "companies_company"."rdv_solidarites_id", - EXISTS - (SELECT %s AS "a" - FROM "companies_companymembership" U0 - WHERE (U0."company_id" = ("companies_company"."id") - AND U0."is_active") - LIMIT 1) AS "has_active_members" - FROM "companies_company" - WHERE (NOT ("companies_company"."siret" = %s) - AND "companies_company"."id" = %s) + AND "users_user"."id" = %s) LIMIT 21 ''', }), dict({ 'origin': list([ 'Company.has_member[common_apps/organizations/models.py]', - 'UpdateJobSeekerStep1View.dispatch[www/apply/views/submit_views.py]', + 'UpdateJobSeekerStep1View.dispatch[www/job_seekers_views/views.py]', ]), 'sql': ''' SELECT %s AS "a" @@ -6343,51 +6327,6 @@ 'origin': list([ 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', - ]), - 'sql': ''' - SELECT "users_user"."id", - "users_user"."password", - "users_user"."last_login", - "users_user"."is_superuser", - "users_user"."username", - "users_user"."first_name", - "users_user"."last_name", - "users_user"."is_staff", - "users_user"."is_active", - "users_user"."date_joined", - "users_user"."address_line_1", - "users_user"."address_line_2", - "users_user"."post_code", - "users_user"."city", - "users_user"."department", - "users_user"."coords", - "users_user"."geocoding_score", - "users_user"."geocoding_updated_at", - "users_user"."ban_api_resolved_address", - "users_user"."insee_city_id", - "users_user"."title", - "users_user"."email", - "users_user"."phone", - "users_user"."kind", - "users_user"."identity_provider", - "users_user"."has_completed_welcoming_tour", - "users_user"."created_by_id", - "users_user"."external_data_source_history", - "users_user"."last_checked_at", - "users_user"."public_id", - "users_user"."address_filled_at", - "users_user"."first_login" - FROM "users_user" - WHERE ("users_user"."kind" = %s - AND "users_user"."public_id" = %s) - LIMIT 21 - ''', - }), - dict({ - 'origin': list([ - 'UpdateJobSeekerStep2View.setup[www/apply/views/submit_views.py]', - 'UpdateJobSeekerStep2View.setup[utils/session.py]', - 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', ]), 'sql': ''' @@ -6438,10 +6377,54 @@ LIMIT 21 ''', }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep2View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "users_user"."id", + "users_user"."password", + "users_user"."last_login", + "users_user"."is_superuser", + "users_user"."username", + "users_user"."first_name", + "users_user"."last_name", + "users_user"."is_staff", + "users_user"."is_active", + "users_user"."date_joined", + "users_user"."address_line_1", + "users_user"."address_line_2", + "users_user"."post_code", + "users_user"."city", + "users_user"."department", + "users_user"."coords", + "users_user"."geocoding_score", + "users_user"."geocoding_updated_at", + "users_user"."ban_api_resolved_address", + "users_user"."insee_city_id", + "users_user"."title", + "users_user"."email", + "users_user"."phone", + "users_user"."kind", + "users_user"."identity_provider", + "users_user"."has_completed_welcoming_tour", + "users_user"."created_by_id", + "users_user"."external_data_source_history", + "users_user"."last_checked_at", + "users_user"."public_id", + "users_user"."address_filled_at", + "users_user"."first_login" + FROM "users_user" + WHERE ("users_user"."kind" = %s + AND "users_user"."id" = %s) + LIMIT 21 + ''', + }), dict({ 'origin': list([ 'Company.has_member[common_apps/organizations/models.py]', - 'UpdateJobSeekerStep2View.dispatch[www/apply/views/submit_views.py]', + 'UpdateJobSeekerStep2View.dispatch[www/job_seekers_views/views.py]', ]), 'sql': ''' SELECT %s AS "a" @@ -6665,6 +6648,60 @@ ]), 'sql': 'SAVEPOINT ""', }), + dict({ + 'origin': list([ + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', + ]), + 'sql': ''' + SELECT "companies_company"."id", + "companies_company"."address_line_1", + "companies_company"."address_line_2", + "companies_company"."post_code", + "companies_company"."city", + "companies_company"."department", + "companies_company"."coords", + "companies_company"."geocoding_score", + "companies_company"."geocoding_updated_at", + "companies_company"."ban_api_resolved_address", + "companies_company"."insee_city_id", + "companies_company"."name", + "companies_company"."created_at", + "companies_company"."updated_at", + "companies_company"."uid", + "companies_company"."active_members_email_reminder_last_sent_at", + "companies_company"."automatic_geocoding_update", + "companies_company"."siret", + "companies_company"."naf", + "companies_company"."kind", + "companies_company"."brand", + "companies_company"."phone", + "companies_company"."email", + "companies_company"."auth_email", + "companies_company"."website", + "companies_company"."description", + "companies_company"."provided_support", + "companies_company"."source", + "companies_company"."created_by_id", + "companies_company"."block_job_applications", + "companies_company"."job_applications_blocked_at", + "companies_company"."convention_id", + "companies_company"."job_app_score", + "companies_company"."is_searchable", + "companies_company"."rdv_solidarites_id", + EXISTS + (SELECT %s AS "a" + FROM "companies_companymembership" U0 + WHERE (U0."company_id" = ("companies_company"."id") + AND U0."is_active") + LIMIT 1) AS "has_active_members" + FROM "companies_company" + WHERE (NOT ("companies_company"."siret" = %s) + AND "companies_company"."id" = %s) + LIMIT 21 + ''', + }), dict({ 'origin': list([ 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', @@ -6736,69 +6773,14 @@ FROM "users_user" LEFT OUTER JOIN "users_jobseekerprofile" ON ("users_user"."id" = "users_jobseekerprofile"."user_id") WHERE ("users_user"."kind" = %s - AND "users_user"."public_id" = %s) - LIMIT 21 - ''', - }), - dict({ - 'origin': list([ - 'UpdateJobSeekerStep3View.setup[www/apply/views/submit_views.py]', - 'UpdateJobSeekerStep3View.setup[utils/session.py]', - 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', - 'UpdateJobSeekerStep3View.setup[www/job_seekers_views/views.py]', - ]), - 'sql': ''' - SELECT "companies_company"."id", - "companies_company"."address_line_1", - "companies_company"."address_line_2", - "companies_company"."post_code", - "companies_company"."city", - "companies_company"."department", - "companies_company"."coords", - "companies_company"."geocoding_score", - "companies_company"."geocoding_updated_at", - "companies_company"."ban_api_resolved_address", - "companies_company"."insee_city_id", - "companies_company"."name", - "companies_company"."created_at", - "companies_company"."updated_at", - "companies_company"."uid", - "companies_company"."active_members_email_reminder_last_sent_at", - "companies_company"."automatic_geocoding_update", - "companies_company"."siret", - "companies_company"."naf", - "companies_company"."kind", - "companies_company"."brand", - "companies_company"."phone", - "companies_company"."email", - "companies_company"."auth_email", - "companies_company"."website", - "companies_company"."description", - "companies_company"."provided_support", - "companies_company"."source", - "companies_company"."created_by_id", - "companies_company"."block_job_applications", - "companies_company"."job_applications_blocked_at", - "companies_company"."convention_id", - "companies_company"."job_app_score", - "companies_company"."is_searchable", - "companies_company"."rdv_solidarites_id", - EXISTS - (SELECT %s AS "a" - FROM "companies_companymembership" U0 - WHERE (U0."company_id" = ("companies_company"."id") - AND U0."is_active") - LIMIT 1) AS "has_active_members" - FROM "companies_company" - WHERE (NOT ("companies_company"."siret" = %s) - AND "companies_company"."id" = %s) + AND "users_user"."id" = %s) LIMIT 21 ''', }), dict({ 'origin': list([ 'Company.has_member[common_apps/organizations/models.py]', - 'UpdateJobSeekerStep3View.dispatch[www/apply/views/submit_views.py]', + 'UpdateJobSeekerStep3View.dispatch[www/job_seekers_views/views.py]', ]), 'sql': ''' SELECT %s AS "a" diff --git a/tests/www/apply/test_process_external_transfer.py b/tests/www/apply/test_process_external_transfer.py index b18afd69b63..9272fe67ddf 100644 --- a/tests/www/apply/test_process_external_transfer.py +++ b/tests/www/apply/test_process_external_transfer.py @@ -14,7 +14,7 @@ from tests.companies.factories import CompanyFactory, CompanyMembershipFactory, JobDescriptionFactory from tests.job_applications.factories import JobApplicationFactory from tests.jobs.factories import create_test_romes_and_appellations -from tests.utils.test import parse_response_to_soup +from tests.utils.test import KNOWN_SESSION_KEYS, parse_response_to_soup INTERNAL_TRANSFER_CONFIRM_BUTTON = """ @@ -271,7 +271,13 @@ def test_step_2(client, snapshot): ) transfer_step_3_url = f"{transfer_step_3_base_url}?back_url={quote(transfer_step_2_url)}" assertRedirects(response, transfer_step_3_url) - assert client.session[f"job_application-{other_company.pk}"] == {"selected_jobs": []} + [job_seeker_session_name] = [ + k for k in client.session.keys() if k not in KNOWN_SESSION_KEYS and not k.startswith("job_application") + ] + assert client.session[f"job_application-{other_company.pk}"] == { + "selected_jobs": [], + "job_seeker_session_name": job_seeker_session_name, + } # With selected job transfer_step_2_url = ( @@ -286,7 +292,10 @@ def test_step_2(client, snapshot): response = client.post(transfer_step_2_url, data={"selected_jobs": [job_id]}) transfer_step_3_url = f"{transfer_step_3_base_url}?back_url={quote(transfer_step_2_url)}" assertRedirects(response, transfer_step_3_url) - assert client.session[f"job_application-{other_company.pk}"] == {"selected_jobs": [job_id]} + assert client.session[f"job_application-{other_company.pk}"] == { + "selected_jobs": [job_id], + "job_seeker_session_name": job_seeker_session_name, + } @freeze_time("2024-07-15 11:52:23") @@ -532,7 +541,13 @@ def test_full_process(client): ) transfer_step_3_url = f"{transfer_step_3_base_url}?back_url={quote(transfer_step_2_url)}" assertRedirects(response, transfer_step_3_url) - assert client.session[f"job_application-{other_company.pk}"] == {"selected_jobs": []} + [job_seeker_session_name] = [ + k for k in client.session.keys() if k not in KNOWN_SESSION_KEYS and not k.startswith("job_application") + ] + assert client.session[f"job_application-{other_company.pk}"] == { + "selected_jobs": [], + "job_seeker_session_name": job_seeker_session_name, + } # STEP 3 response = client.get(transfer_step_3_url) diff --git a/tests/www/apply/test_submit.py b/tests/www/apply/test_submit.py index 05a5fc56ed7..32807f8e7b6 100644 --- a/tests/www/apply/test_submit.py +++ b/tests/www/apply/test_submit.py @@ -266,7 +266,17 @@ def test_404_when_trying_to_update_a_prescriber(self, client): "job_seekers_views:update_job_seeker_step_3_for_hire", "job_seekers_views:update_job_seeker_step_end_for_hire", ): - url = reverse(viewname, kwargs={"company_pk": company.pk, "job_seeker_public_id": prescriber.public_id}) + job_seeker_session = SessionNamespace.create_uuid_namespace( + client.session, + data={ + "config": { + "reset_url": "", + }, + "apply": {"company_pk": company.pk}, + "job_seeker_pk": prescriber.pk, + }, + ) + url = reverse(viewname, kwargs={"session_uuid": job_seeker_session.name}) response = client.get(url) assert response.status_code == 404 @@ -458,7 +468,14 @@ def test_apply_as_jobseeker(self, client, pdf_file): response = client.post(next_url, data={"selected_jobs": [selected_job.pk]}) assert response.status_code == 302 - assert client.session[f"job_application-{company.pk}"] == {"selected_jobs": [selected_job.pk]} + # Job seeker session for update views + [job_seeker_session_name] = [ + k for k in client.session.keys() if k not in KNOWN_SESSION_KEYS and not k.startswith("job_application") + ] + assert client.session[f"job_application-{company.pk}"] == { + "selected_jobs": [selected_job.pk], + "job_seeker_session_name": job_seeker_session_name, + } next_url = reverse( "apply:application_eligibility", kwargs={"company_pk": company.pk, "job_seeker_public_id": user.public_id} @@ -1041,7 +1058,14 @@ def test_apply_as_prescriber_with_pending_authorization(self, client, pdf_file): response = client.post(next_url, data={"selected_jobs": [selected_job.pk]}) assert response.status_code == 302 - assert client.session[f"job_application-{company.pk}"] == {"selected_jobs": [selected_job.pk]} + # Job seeker session for update views + [job_seeker_session_name] = [ + k for k in client.session.keys() if k not in KNOWN_SESSION_KEYS and not k.startswith("job_application") + ] + assert client.session[f"job_application-{company.pk}"] == { + "selected_jobs": [selected_job.pk], + "job_seeker_session_name": job_seeker_session_name, + } next_url = reverse( "apply:application_eligibility", @@ -1312,7 +1336,14 @@ def test_apply_as_authorized_prescriber(self, client, pdf_file): response = client.post(next_url, data={"selected_jobs": [selected_job.pk]}) assert response.status_code == 302 - assert client.session[f"job_application-{company.pk}"] == {"selected_jobs": [selected_job.pk]} + # Job seeker session for update views + [job_seeker_session_name] = [ + k for k in client.session.keys() if k not in KNOWN_SESSION_KEYS and not k.startswith("job_application") + ] + assert client.session[f"job_application-{company.pk}"] == { + "selected_jobs": [selected_job.pk], + "job_seeker_session_name": job_seeker_session_name, + } next_url = reverse( "apply:application_eligibility", @@ -1785,7 +1816,14 @@ def test_apply_as_prescriber(self, client, pdf_file): response = client.post(next_url, data={"selected_jobs": [selected_job.pk]}) assert response.status_code == 302 - assert client.session[f"job_application-{company.pk}"] == {"selected_jobs": [selected_job.pk]} + # Job seeker session for update views + [job_seeker_session_name] = [ + k for k in client.session.keys() if k not in KNOWN_SESSION_KEYS and not k.startswith("job_application") + ] + assert client.session[f"job_application-{company.pk}"] == { + "selected_jobs": [selected_job.pk], + "job_seeker_session_name": job_seeker_session_name, + } next_url = reverse( "apply:application_eligibility", @@ -2373,7 +2411,14 @@ def _test_apply_as_company(self, client, user, company, dummy_job_seeker, pdf_fi response = client.post(next_url, data={"selected_jobs": [selected_job.pk]}) assert response.status_code == 302 - assert client.session[f"job_application-{company.pk}"] == {"selected_jobs": [selected_job.pk]} + # Job seeker session for update views + [job_seeker_session_name] = [ + k for k in client.session.keys() if k not in KNOWN_SESSION_KEYS and not k.startswith("job_application") + ] + assert client.session[f"job_application-{company.pk}"] == { + "selected_jobs": [selected_job.pk], + "job_seeker_session_name": job_seeker_session_name, + } next_url = reverse( "apply:application_eligibility", @@ -3442,9 +3487,12 @@ def _check_last_checked_at(self, client, user, sees_warning, sees_verify_link): assert response.status_code == 200 # Check the presence of the verify link + [job_seeker_session_name] = [ + k for k in client.session.keys() if k not in KNOWN_SESSION_KEYS and not k.startswith("job_application") + ] update_url = reverse( "job_seekers_views:update_job_seeker_step_1", - kwargs={"company_pk": self.company.pk, "job_seeker_public_id": self.job_seeker.public_id}, + kwargs={"session_uuid": job_seeker_session_name}, ) link_check = assertContains if sees_verify_link else assertNotContains link_check(response, f'Vérifier le profil', html=True) @@ -3482,7 +3530,7 @@ def test_unauthorized_prescriber_that_created_the_job_seeker(self, client): class UpdateJobSeekerTestMixin: @pytest.fixture(autouse=True) - def setup_method(self, settings, mocker): + def setup_method(self, client, settings, mocker): self.company = CompanyFactory(subject_to_eligibility=True, with_membership=True) self.job_seeker = JobSeekerFactory( with_ban_geoloc_address=True, @@ -3490,26 +3538,40 @@ def setup_method(self, settings, mocker): jobseeker_profile__birthdate=datetime.date(1978, 12, 20), title="M", ) + self.session_config = { + "config": { + "reset_url": reverse( + self.FINAL_REDIRECT_VIEW_NAME, + kwargs={"company_pk": self.company.pk, "job_seeker_public_id": self.job_seeker.public_id}, + ) + }, + "apply": {"company_pk": self.company.pk}, + "job_seeker_pk": self.job_seeker.pk, + } + + job_seeker_session = SessionNamespace.create_uuid_namespace(client.session, data=self.session_config) + job_seeker_session.save() self.step_1_url = reverse( self.STEP_1_VIEW_NAME, - kwargs={"company_pk": self.company.pk, "job_seeker_public_id": self.job_seeker.public_id}, + kwargs={"session_uuid": job_seeker_session.name}, ) self.step_2_url = reverse( self.STEP_2_VIEW_NAME, - kwargs={"company_pk": self.company.pk, "job_seeker_public_id": self.job_seeker.public_id}, + kwargs={"session_uuid": job_seeker_session.name}, ) self.step_3_url = reverse( self.STEP_3_VIEW_NAME, - kwargs={"company_pk": self.company.pk, "job_seeker_public_id": self.job_seeker.public_id}, + kwargs={"session_uuid": job_seeker_session.name}, ) self.step_end_url = reverse( self.STEP_END_VIEW_NAME, - kwargs={"company_pk": self.company.pk, "job_seeker_public_id": self.job_seeker.public_id}, + kwargs={"session_uuid": job_seeker_session.name}, ) + self.job_seeker_session_key = job_seeker_session.name + [self.city] = create_test_cities(["67"], num_per_department=1) self.INFO_MODIFIABLE_PAR_CANDIDAT_UNIQUEMENT = "Informations modifiables par le candidat uniquement" - self.job_seeker_session_key = f"job_seeker-{self.job_seeker.public_id}" settings.API_BAN_BASE_URL = "http://ban-api" mocker.patch( @@ -3530,8 +3592,8 @@ def _check_nothing_permitted(self, client, user): def _check_that_last_step_doesnt_crash_with_direct_access(self, client, user): client.force_login(user) - client.get(self.step_1_url) # Setup job_seeker_session - client.get(self.step_end_url) # Use partial job_seeker_session + + client.get(self.step_end_url) # no need to setup with step_1, use partial job_seeker_session def _check_everything_allowed(self, client, snapshot, user, extra_post_data_1=None): client.force_login(user) @@ -3606,7 +3668,7 @@ def _check_everything_allowed(self, client, snapshot, user, extra_post_data_1=No "nir": nir or self.job_seeker.jobseeker_profile.nir, "lack_of_nir_reason": lack_of_nir_reason, }, - } + } | self.session_config assert client.session[self.job_seeker_session_key] == expected_job_seeker_session self.job_seeker.refresh_from_db() assert self.job_seeker.first_name != NEW_FIRST_NAME @@ -3732,7 +3794,7 @@ def _check_only_administrative_allowed(self, client, user): assertRedirects(response, self.step_2_url, fetch_redirect_response=False) # Session is created - expected_job_seeker_session = {"user": {}} + expected_job_seeker_session = {"user": {}} | self.session_config assert client.session[self.job_seeker_session_key] == expected_job_seeker_session # STEP 2 @@ -3819,15 +3881,15 @@ def test_anonymous_step_1(self, client): def test_anonymous_step_2(self, client): response = client.get(self.step_2_url) - assert response.status_code == 403 + assert response.status_code == 302 # session isn't missing, but not logged in def test_anonymous_step_3(self, client): response = client.get(self.step_3_url) - assert response.status_code == 403 + assert response.status_code == 302 # session isn't missing, but not logged in def test_anonymous_step_end(self, client): response = client.get(self.step_end_url) - assert response.status_code == 403 + assert response.status_code == 302 # session isn't missing, but not logged in def test_as_job_seeker(self, client): self._check_nothing_permitted(client, self.job_seeker) @@ -3917,13 +3979,16 @@ def test_as_company_with_non_proxied_job_seeker(self, client): def test_without_job_seeker_session(self, client): client.force_login(self.company.members.first()) + invalid_session_name = uuid.uuid4() + kwargs = {"session_uuid": invalid_session_name} for url in [ - self.step_2_url, - self.step_3_url, - self.step_end_url, + reverse("job_seekers_views:update_job_seeker_step_1", kwargs=kwargs), + reverse("job_seekers_views:update_job_seeker_step_2", kwargs=kwargs), + reverse("job_seekers_views:update_job_seeker_step_3", kwargs=kwargs), + reverse("job_seekers_views:update_job_seeker_step_end", kwargs=kwargs), ]: response = client.get(url) - assert response.status_code == 403 + assert response.status_code == 404 def test_with_job_seeker_without_nir(self, client, snapshot): # Make sure the job seeker does not manage its own account (and has no nir) @@ -3974,15 +4039,15 @@ def test_anonymous_step_1(self, client): def test_anonymous_step_2(self, client): response = client.get(self.step_2_url) - assert response.status_code == 403 + assert response.status_code == 302 # session isn't missing, but not logged in def test_anonymous_step_3(self, client): response = client.get(self.step_3_url) - assert response.status_code == 403 + assert response.status_code == 302 # session isn't missing, but not logged in def test_anonymous_step_end(self, client): response = client.get(self.step_end_url) - assert response.status_code == 403 + assert response.status_code == 302 # session isn't missing, but not logged in def test_as_job_seeker(self, client): self._check_nothing_permitted(client, self.job_seeker) @@ -4048,13 +4113,16 @@ def test_as_company_with_non_proxied_job_seeker(self, client): def test_without_job_seeker_session(self, client): client.force_login(self.company.members.first()) + invalid_session_name = uuid.uuid4() + kwargs = {"session_uuid": invalid_session_name} for url in [ - self.step_2_url, - self.step_3_url, - self.step_end_url, + reverse("job_seekers_views:update_job_seeker_step_1_for_hire", kwargs=kwargs), + reverse("job_seekers_views:update_job_seeker_step_2_for_hire", kwargs=kwargs), + reverse("job_seekers_views:update_job_seeker_step_3_for_hire", kwargs=kwargs), + reverse("job_seekers_views:update_job_seeker_step_end_for_hire", kwargs=kwargs), ]: response = client.get(url) - assert response.status_code == 403 + assert response.status_code == 404 def test_with_job_seeker_without_nir(self, client, snapshot): # Make sure the job seeker does not manage its own account (and has no nir) @@ -4106,21 +4174,17 @@ def test_job_seeker_with_profile_has_check_boxes_ticked_in_step3(self, client): ) apply_session.save() - # STEP 1 to setup jobseeker session - response = client.get( + # Step ApplicationJobs to init the job_seeker_session + client.get( reverse( - "job_seekers_views:update_job_seeker_step_1", + "apply:application_jobs", kwargs={"company_pk": company.pk, "job_seeker_public_id": job_seeker.public_id}, ) ) - assert response.status_code == 200 - # Go straight to STEP 3 + job_seeker_session_name = client.session[apply_session.name].get("job_seeker_session_name") response = client.get( - reverse( - "job_seekers_views:update_job_seeker_step_3", - kwargs={"company_pk": company.pk, "job_seeker_public_id": job_seeker.public_id}, - ) + reverse("job_seekers_views:update_job_seeker_step_3", kwargs={"session_uuid": job_seeker_session_name}) ) assertContains( response, @@ -4895,6 +4959,9 @@ def test_company(self, client): kwargs={"company_pk": company.pk, "job_seeker_public_id": job_seeker.public_id}, ) ) + [job_seeker_session_name] = [ + k for k in client.session.keys() if k not in KNOWN_SESSION_KEYS and not k.startswith("job_application") + ] assertContains( response, '

Informations personnelles de Son Prénom Son Nom De Famille

', @@ -4906,7 +4973,7 @@ def test_company(self, client): response, reverse( "job_seekers_views:update_job_seeker_step_1_for_hire", - kwargs={"company_pk": company.pk, "job_seeker_public_id": job_seeker.public_id}, + kwargs={"session_uuid": job_seeker_session_name}, ), ) assertContains( @@ -4938,6 +5005,9 @@ def test_geiq(self, client): kwargs={"company_pk": company.pk, "job_seeker_public_id": job_seeker.public_id}, ) ) + [job_seeker_session_name] = [ + k for k in client.session.keys() if k not in KNOWN_SESSION_KEYS and not k.startswith("job_application") + ] assertContains( response, '

Informations personnelles de Son Prénom Son Nom De Famille

', @@ -4948,7 +5018,7 @@ def test_geiq(self, client): response, reverse( "job_seekers_views:update_job_seeker_step_1_for_hire", - kwargs={"company_pk": company.pk, "job_seeker_public_id": job_seeker.public_id}, + kwargs={"session_uuid": job_seeker_session_name}, ), ) assertContains( diff --git a/tests/www/apply/test_submit_from_job_seekers_list.py b/tests/www/apply/test_submit_from_job_seekers_list.py index 4d687b52bcc..cc4385360a0 100644 --- a/tests/www/apply/test_submit_from_job_seekers_list.py +++ b/tests/www/apply/test_submit_from_job_seekers_list.py @@ -11,6 +11,7 @@ from tests.companies.factories import CompanyWithMembershipAndJobsFactory, JobDescriptionFactory from tests.job_applications.factories import JobApplicationFactory from tests.users.factories import JobSeekerFactory, PrescriberFactory +from tests.utils.test import KNOWN_SESSION_KEYS class TestApplyAsPrescriber: @@ -127,7 +128,13 @@ def test_apply_as_prescriber(self, client): response = client.post(next_url, data={"selected_jobs": [selected_job.pk]}) assert response.status_code == 302 - assert client.session[f"job_application-{guerande_company.pk}"] == {"selected_jobs": [selected_job.pk]} + [job_seeker_session_name] = [ + k for k in client.session.keys() if k not in KNOWN_SESSION_KEYS and not k.startswith("job_application") + ] + assert client.session[f"job_application-{guerande_company.pk}"] == { + "selected_jobs": [selected_job.pk], + "job_seeker_session_name": job_seeker_session_name, + } next_url = reverse( "apply:application_eligibility", @@ -294,7 +301,13 @@ def test_apply_as_prescriber_without_seeing_personal_info(self, client): response = client.post(next_url, data={"selected_jobs": [selected_job.pk]}) assert response.status_code == 302 - assert client.session[f"job_application-{guerande_company.pk}"] == {"selected_jobs": [selected_job.pk]} + [job_seeker_session_name] = [ + k for k in client.session.keys() if k not in KNOWN_SESSION_KEYS and not k.startswith("job_application") + ] + assert client.session[f"job_application-{guerande_company.pk}"] == { + "selected_jobs": [selected_job.pk], + "job_seeker_session_name": job_seeker_session_name, + } next_url = reverse( "apply:application_eligibility", @@ -469,9 +482,14 @@ def test_apply_as_company(self, client): selected_job = other_company.job_description_through.first() response = client.post(next_url, data={"selected_jobs": [selected_job.pk]}) - assert response.status_code == 302 - - assert client.session[f"job_application-{other_company.pk}"] == {"selected_jobs": [selected_job.pk]} + [job_seeker_session_name] = [ + k for k in client.session.keys() if k not in KNOWN_SESSION_KEYS and not k.startswith("job_application") + ] + + assert client.session[f"job_application-{other_company.pk}"] == { + "selected_jobs": [selected_job.pk], + "job_seeker_session_name": job_seeker_session_name, + } next_url = reverse( "apply:application_eligibility",