Commit 9526c024 authored by Flavio TARSETTI's avatar Flavio TARSETTI

[web][accounts] refactor supervisor new supervisee request

parent 973477f1
......@@ -52,6 +52,7 @@ from .serializers import SupervisionTrackUpdateSerializer
from .serializers import UserSerializer
from .views import accept_supervisee
from .views import emergency_rejection
from .views import inform_supervisor_new_supervisee_request
from .views import perform_revalidation
from .views import supervisee_rejection
......@@ -518,21 +519,8 @@ class SuperviseeAddSupervisorView(BaseCreateSupervisionTrackViewSupervisee):
supervisee.save()
# Inform by email the supervisor that he has a new supervisee request
temp_url = TemporaryUrl.objects.create_temporary_url(
TemporaryUrl.VALIDATION, supervisiontrack
)
context = {
"supervisor": supervisor,
"supervisee": supervisee,
"prefix": server_address,
"temp_url": temp_url.url_hash,
}
mail.send_email(
"registration/mail.supervisor_validation.subject.txt",
"registration/mail.supervisor_validation_supervisee_add_request.message.txt",
context,
[supervisor.email],
_ = inform_supervisor_new_supervisee_request(
request, supervisiontrack, supervisor, supervisee
)
return Response(status=status.HTTP_204_NO_CONTENT)
......
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