diff --git a/apps/participation/templates/participation/chat.html b/apps/participation/templates/participation/chat.html index bbdd0f4..602e1f7 100644 --- a/apps/participation/templates/participation/chat.html +++ b/apps/participation/templates/participation/chat.html @@ -1,16 +1,39 @@ {% extends "base.html" %} -{% block extracss %} - -{% endblock %} +{% load i18n %} -{% block fullcontent %} - +{% block content %} +
+ {% blocktrans trimmed %} + The chat is located on the dedicated Matrix server: + {% endblocktrans %} +
+ +
+ + {% trans "Access to the Matrix server" %} + +
+ +
+

+ {% blocktrans trimmed %} + To connect to the server, you can select "Log in", then use your credentials of this platform to connect + with the central authentication server, then you must trust the connection between the Matrix account and the + platform. Finally, you will be able to access to the chat platform. + {% endblocktrans %} +

+ +

+ {% blocktrans trimmed %} + You will be invited in some basic rooms. You must confirm the invitations to join channels. + {% endblocktrans %} +

+ +

+ {% blocktrans trimmed %} + If you have any trouble, don't hesitate to contact us :) + {% endblocktrans %} +

+
{% endblock %} diff --git a/apps/registration/forms.py b/apps/registration/forms.py index 18d76eb..b533e73 100644 --- a/apps/registration/forms.py +++ b/apps/registration/forms.py @@ -22,6 +22,15 @@ class SignupForm(UserCreationForm): ], ) + def clean_email(self): + """ + Ensure that the email address is unique. + """ + email = self.data["email"] + if User.objects.filter(email=email).exists(): + self.add_error("email", _("This email address is already used.")) + return email + def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.fields["first_name"].required = True diff --git a/apps/registration/tests.py b/apps/registration/tests.py index e43aabc..f732f16 100644 --- a/apps/registration/tests.py +++ b/apps/registration/tests.py @@ -119,6 +119,20 @@ class TestRegistration(TestCase): self.assertRedirects(response, reverse("registration:email_validation_sent"), 302, 200) self.assertTrue(User.objects.filter(email="toto@example.com").exists()) + # Email is already used + response = self.client.post(reverse("registration:signup"), data=dict( + last_name="Toto", + first_name="Toto", + email="toto@example.com", + password1="azertyuiopazertyuiop", + password2="azertyuiopazertyuiop", + role="participant", + student_class=12, + school="God", + give_contact_to_animath=False, + )) + self.assertEqual(response.status_code, 200) + response = self.client.get(reverse("registration:email_validation_sent")) self.assertEqual(response.status_code, 200) diff --git a/corres2math/templates/index.html b/corres2math/templates/index.html index f3d997a..932b97a 100644 --- a/corres2math/templates/index.html +++ b/corres2math/templates/index.html @@ -27,6 +27,11 @@ +
+ Avertissement : certains rencontrent des difficultés à recevoir les mails automatiques. Merci de vérifier + régulièrement votre boîte spam, et à nous contacter en cas de problème. +
+
Comment ça marche ?

diff --git a/locale/fr/LC_MESSAGES/django.po b/locale/fr/LC_MESSAGES/django.po index 984e3a1..eb82b5d 100644 --- a/locale/fr/LC_MESSAGES/django.po +++ b/locale/fr/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Corres2math\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2020-11-16 11:55+0100\n" +"POT-Creation-Date: 2020-12-04 01:42+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Yohann D'ANELLO \n" "Language-Team: LANGUAGE \n" @@ -289,6 +289,40 @@ msgstr "phase" msgid "phases" msgstr "phases" +#: apps/participation/templates/participation/chat.html:7 +msgid "The chat is located on the dedicated Matrix server:" +msgstr "Le chat est situé sur le serveur Matrix dédié aux Correspondances :" + +#: apps/participation/templates/participation/chat.html:14 +msgid "Access to the Matrix server" +msgstr "Accéder au serveur Matrix" + +#: apps/participation/templates/participation/chat.html:20 +msgid "" +"To connect to the server, you can select \"Log in\", then use your " +"credentials of this platform to connect with the central authentication " +"server, then you must trust the connection between the Matrix account and " +"the platform. Finally, you will be able to access to the chat platform." +msgstr "" +"Pour se connecter au serveur, vous pouvez sélectionner \"Se connecter\", " +"puis utiliser vos identifiants de cette plateforme via l'authentication " +"centralisée. Vous devrez ensuite approuver la connexion entre le compte " +"Matrix et la plateforme. Enfin, vous pourrez accéder à la plateforme de chat." + +#: apps/participation/templates/participation/chat.html:28 +msgid "" +"You will be invited in some basic rooms. You must confirm the invitations to " +"join channels." +msgstr "" +"Vous serez invités dans quelques salons basiques. Vous devez confirmer les " +"invitations pour rejoindre les canaux." + +#: apps/participation/templates/participation/chat.html:34 +msgid "If you have any trouble, don't hesitate to contact us :)" +msgstr "" +"Si vous rencontrez le moindre problème, n'hésitez surtout pas à nous " +"contacter :)" + #: apps/participation/templates/participation/create_team.html:11 #: corres2math/templates/base.html:237 msgid "Create" @@ -751,7 +785,11 @@ msgstr "participant" msgid "coach" msgstr "encadrant" -#: apps/registration/forms.py:68 +#: apps/registration/forms.py:31 +msgid "This email address is already used." +msgstr "Cette adresse e-mail est déjà utilisée." + +#: apps/registration/forms.py:77 msgid "The uploaded file must be a PDF, PNG of JPEG file." msgstr "Le fichier envoyé doit être au format PDF, PNG ou JPEG."