Commit b8faad32 authored by Flavio TARSETTI's avatar Flavio TARSETTI

[accounts][views] add new supervisee request function

parent af2e7192
......@@ -412,3 +412,32 @@ def load_temporary_url_rejection(request, hash_url):
return generate_load_response(
request, temp_url, "accounts/url_rejection_failed.html", {}
)
def inform_supervisor_new_supervisee_request(
request, supervisiontrack, supervisor, supervisee
):
# Inform by email the supervisor that he has a new supervisee request
temp_url = TemporaryUrl.objects.create_temporary_url(
TemporaryUrl.VALIDATION, supervisiontrack
)
supervisor_validation_url = request.build_absolute_uri(
reverse("accounts:temp_url_validation", kwargs={"hash_url": temp_url.url_hash},)
)
contact_url = request.build_absolute_uri(reverse("contact"))
context = {
"supervisor": supervisor,
"supervisee": supervisee,
"supervisor_validation_url": supervisor_validation_url,
"contact_url": contact_url,
}
mail.send_email(
"registration/mail.supervisor_validation.subject.txt",
"registration/mail.supervisor_validation_supervisee_add_request.message.txt",
context,
[supervisor.email],
)
return context
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment