Skip to content

Commit 5df2b7d

Browse files
committed
apply: display ROME code next to job's title in filter
1 parent de82cee commit 5df2b7d

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

itou/www/apply/forms.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,7 @@ def _get_choices_for_jobs(self):
907907
jobs = set()
908908
for job_application in self.job_applications_qs.prefetch_related("selected_jobs__appellation"):
909909
for job in job_application.selected_jobs.all():
910-
jobs.add((job.pk, job.display_name))
910+
jobs.add((job.pk, f"{job.display_name} ({job.appellation.code})"))
911911
return sorted(jobs, key=lambda job: job[1])
912912

913913
def _get_choices_for_job_seeker(self, users):
@@ -962,7 +962,7 @@ def _get_choices_for_jobs(self):
962962
jobs = set()
963963
for job_application in self.job_applications_qs.prefetch_related("selected_jobs__appellation"):
964964
for job in job_application.selected_jobs.all():
965-
jobs.add((job.appellation.code, job.appellation.name))
965+
jobs.add((job.appellation.code, f"{job.appellation.name} ({job.appellation.code})"))
966966
return sorted(jobs, key=lambda job: job[1])
967967

968968
def get_to_companies_choices(self):

tests/www/apply/test_list_for_siae.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,9 @@ def test_list_for_siae(self, client, snapshot):
100100
name="{self.SELECTED_JOBS}"
101101
type="checkbox"
102102
value="{job1.pk}">
103-
<label for="id_selected_jobs_0-top" class="form-check-label">{job1.display_name}</label>
103+
<label for="id_selected_jobs_0-top" class="form-check-label">
104+
{job1.display_name} ({job1.appellation.code})
105+
</label>
104106
</div>
105107
</li>
106108
<li class="dropdown-item">
@@ -111,7 +113,9 @@ def test_list_for_siae(self, client, snapshot):
111113
name="{self.SELECTED_JOBS}"
112114
type="checkbox"
113115
value="{job2.pk}">
114-
<label for="id_selected_jobs_1-top" class="form-check-label">{job2.display_name}</label>
116+
<label for="id_selected_jobs_1-top" class="form-check-label">
117+
{job2.display_name} ({job2.appellation.code})
118+
</label>
115119
</div>
116120
</li>
117121
</ul>

0 commit comments

Comments
 (0)