Commit f42e8383 authored by Samuel GAIST's avatar Samuel GAIST

Merge branch '585_fix_emails_temp_url_expiration_date_complete_procedure' into 'master'

Add expiration date and procedure and manual procedure to help users interact with account emails holding a temporary URL

Closes #585

See merge request !416
parents ed5dc89b 7e69888a
Pipeline #47164 passed with stages
in 17 minutes and 47 seconds
......@@ -259,10 +259,15 @@ def perform_revalidation(request, supervisiontrack, supervisee, now):
)
)
account_settings_url = request.build_absolute_uri(
reverse("accounts:settings")
)
context = {
"supervisor": supervisiontrack.supervisor,
"supervisee": supervisee,
"supervisor_rejection_url": supervisor_rejection_url,
"account_settings": account_settings_url,
"expiry_date": temp_url_rejection.expires,
}
mail.send_email(
......@@ -428,10 +433,14 @@ def inform_supervisor_new_supervisee_request(
reverse("accounts:temp_url_validation", kwargs={"hash_url": temp_url.url_hash},)
)
contact_url = request.build_absolute_uri(reverse("contact"))
account_settings_url = request.build_absolute_uri(reverse("accounts:settings"))
context = {
"supervisor": supervisor,
"supervisee": supervisee,
"supervisor_validation_url": supervisor_validation_url,
"expiry_date": temp_url.expires,
"account_settings": account_settings_url,
"contact_url": contact_url,
}
......
......@@ -140,11 +140,16 @@ class RegistrationManager(models.Manager):
)
)
contact_url = request.build_absolute_uri(reverse("contact"))
account_settings_url = request.build_absolute_uri(
reverse("accounts:settings")
)
context = {
"supervisor": supervisor_user,
"supervisee": user,
"supervisor_validation_url": supervisor_validation_url,
"expiry_date": temp_url.expires,
"account_settings": account_settings_url,
"contact_url": contact_url,
}
......
......@@ -4,8 +4,12 @@ Your supervisee {{ supervisee.username }} ({{supervisee.first_name}} {{supervise
If he's still your current supervisee, you can drop this message.
However if he's not your supervisee anymore, you can immediately revoke your supervision by clicking on the following link:
However if the user is not your supervisee anymore, you can immediately revoke your supervision by clicking on the following link, which expires on {{ expiry_date }}:
{{ supervisor_rejection_url }}
If the above link does not work or is expired, please proceed to your profile settings page with the following
link {{ account_settings }} and from there, under the management of supervisees, you will be able
to manually accept or reject any supervisee.
BEAT Administrators at the Idiap Research Institute
......@@ -12,10 +12,15 @@ Username: {{ supervisee.username }}
If you don't do this the supervisee will not be able to use his account and
will be deleted after 7 days.
You can also click on the following direct link to accomplish this action and accept this new supervisee at:
You can also click on the following direct link, which expires on {{ expiry_date }}, to accomplish this action
and accept this new supervisee at:
{{ supervisor_validation_url }}
If the above link does not work or is expired, please proceed to your profile settings page with the following
link {{ account_settings }} and from there, under the management of supervisees, you will be able
to manually accept or reject any supervisee.
If you are having problems to activate your supervisee account, contact a member of our
support staff at {{ contact_url }}.
......
......@@ -12,10 +12,15 @@ Username: {{ supervisee.username }}
If you don't do this the supervisee will not be able to use his account in
future and will not be recognized as your supervisee.
You can also click on the following direct link to accomplish this action and accept this new supervisee at:
You can also click on the following direct link, which expires on {{ expiry_date }}, to accomplish this action
and accept this new supervisee at:
{{ supervisor_validation_url }}
If the above link does not work or is expired, please proceed to your profile settings page with the following
link {{ account_settings }} and from there, under the management of supervisees, you will be able
to manually accept or reject any supervisee.
If you are having problems to activate your supervisee account, contact a member of our
support staff at {{ contact_url }}.
......
......@@ -117,7 +117,7 @@ class EmailSendingTestCase(ViewTestCase, AccountTestMixin):
kwargs={"hash_url": generate_url_hash()},
)
)
generated_url = text_lines[16]
generated_url = text_lines[17]
self.assertTrue(prefix in generated_url)
self.assertEqual(
......@@ -153,7 +153,7 @@ class EmailSendingTestCase(ViewTestCase, AccountTestMixin):
self.assertEqual(len(mail.outbox), 2)
text_lines = mail.outbox[0].body.split("\n")
generated_url = text_lines[16]
generated_url = text_lines[17]
self.assertTrue(prefix in generated_url)
self.assertEqual(
......
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