Skip to content

Commit

Permalink
Merge branch 'feature/jobOffer'
Browse files Browse the repository at this point in the history
  • Loading branch information
Clément Gérard committed Mar 31, 2022
2 parents 96c3a17 + 993ab56 commit 14f1787
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 2 deletions.
29 changes: 28 additions & 1 deletion organization/job/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
from organization.job.models import JobResponse, JobOffer, Candidacy
from organization.job.forms import JobResponseForm
from mezzanine_agenda.models import Event
from django.utils.safestring import mark_safe

mime_types = [
'pdf',
Expand Down Expand Up @@ -98,7 +99,11 @@ def form_valid(self, form):
email_application_notification(self.request, self.job_offer, form.cleaned_data)
messages.info(
self.request,
_("You have successfully submitted your application.")
mark_safe(
_(
"You have successfully submitted your application.<br>If your application fit our criteria, the Human Resources department will contact you. If you do not hear from us within 6 weeks, you may consider your application unsuccessful. However, unless you indicate otherwise, we will keep your application on file for other possible opportunities." # noqa: E501
)
)
)
return super(JobOfferDetailView, self).form_valid(form)

Expand Down Expand Up @@ -148,6 +153,28 @@ def email_application_notification(request, job_offer, data):
msg.content_subtype = 'html'
msg.send()

# Candidat notification
if job_offer.id == 1:
# Spontaneous application
candidat_subject = "Ircam - Votre candidature spontanée"
candidat_message = get_template(
'email/candidat_spontaneous_application_notification.html'
).render(ctx)
else:
# Publicated job application
candidat_subject = "Ircam - Votre candidature au poste " + job_offer.title
candidat_message = get_template(
'email/candidat_application_notification.html'
).render(ctx)
candidat_msg = EmailMessage(
candidat_subject,
candidat_message,
to=[data['email']],
from_email=from_email
)
candidat_msg.content_subtype = 'html'
candidat_msg.send()

return HttpResponse('email_application_notification')


Expand Down
Binary file modified organization/locale/fr/LC_MESSAGES/django.mo
Binary file not shown.
3 changes: 3 additions & 0 deletions organization/locale/fr/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -1195,3 +1195,6 @@ msgstr "Artiste"

msgid "Video"
msgstr "Vidéo"

msgid "You have successfully submitted your application.<br>If your application fit our criteria, the Human Resources department will contact you. If you do not hear from us within 6 weeks, you may consider your application unsuccessful. However, unless you indicate otherwise, we will keep your application on file for other possible opportunities."
msgstr "Votre candidature a bien été transmise.<br>Si votre profil correspond à nos recherches, le service des ressources humaines vous recontactera. Si nous ne prenons pas contact avec vous dans un délai de 6 semaines, nous vous remercions de bien vouloir considérer que nous ne donnons pas une suite favorable à votre candidature dans l'immédiat. En outre, et sauf avis contraire de votre part, nous nous permettons de conserver votre dossier pour une éventuelle exploitation ultérieure."
1 change: 0 additions & 1 deletion organization/magazine/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
from django.views.generic.detail import DetailView
from django.views.generic.list import ListView
from django.views.generic.base import RedirectView
from django.shortcuts import get_object_or_404
from django.http import Http404
from django.utils.translation import ugettext_lazy as _
from dal import autocomplete
Expand Down

0 comments on commit 14f1787

Please sign in to comment.