Skip to content

Commit

Permalink
Hide Edit button from job desc page when transferring to self
Browse files Browse the repository at this point in the history
Transferring applications to one of my companies should go through
internal transfer instead of external transfer. However, when a user
does an external transfer and selects a job description from one of
their companies, they shouldn’t be offered to modify that job
description, but instead to transfer the application.
  • Loading branch information
francoisfreitag committed Jan 13, 2025
1 parent 89fbfb4 commit cb4a021
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions itou/www/apply/views/process_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,7 @@ def get_context_data(self, **kwargs):
return data | {
"job_app_to_transfer": self.job_application,
"matomo_custom_title": data["matomo_custom_title"] + " (transfert)",
"can_update_job_description": False,
}


Expand Down
28 changes: 28 additions & 0 deletions tests/www/apply/test_process_external_transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,34 @@ def test_step_1(client, snapshot):
)


def test_step_1_same_company(client):
create_test_romes_and_appellations(["N1101"], appellations_per_rome=1)
vannes = create_city_vannes()
company = CompanyFactory(coords=vannes.coords, post_code="56760", with_membership=True)
job = JobDescriptionFactory(company=company)

job_application = JobApplicationFactory(state=JobApplicationState.REFUSED, to_company=company)
employer = job_application.to_company.members.get()
client.force_login(employer)

response = client.get(
reverse(
"apply:job_application_external_transfer_step_1_job_description_card",
kwargs={"job_application_id": job_application.pk, "job_description_id": job.pk},
)
)
assertNotContains(response, POSTULER)
assertContains(
response,
"<span>Transférer la candidature</span>",
count=1,
)
assertNotContains(
response,
reverse("companies_views:update_job_description", kwargs={"job_description_id": job.pk}),
)


def test_step_2_same_company(client):
job_application = JobApplicationFactory(state=JobApplicationState.REFUSED, for_snapshot=True)
company = job_application.to_company
Expand Down

0 comments on commit cb4a021

Please sign in to comment.