From ef413ed986dfa24a30e3f8c5709c1d514a29d8aa Mon Sep 17 00:00:00 2001
From: florimondmanca <florimond.manca@gmail.com>
Date: Tue, 3 Jul 2018 22:50:59 +0100
Subject: [PATCH] fix some urls in project notification templates

---
 projects/models.py                                       | 4 ++--
 .../projects/organizers_participation_received.md        | 2 +-
 projects/templates/projects/participation_received.md    | 9 +++++----
 visits/models.py                                         | 2 +-
 4 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/projects/models.py b/projects/models.py
index dc7d675..cd5783f 100644
--- a/projects/models.py
+++ b/projects/models.py
@@ -85,11 +85,11 @@ class Edition(models.Model):
 
     def get_projects_site_url(self) -> str:
         site = Site.objects.get_current()
-        return f'http://{site.domain}/projets/'
+        return f'https://{site.domain}/projets/'
 
     def get_registration_url(self) -> str:
         site = Site.objects.get_current()
-        return f'http://{site.domain}/projets/mes-inscriptions'
+        return f'https://{site.domain}/projets/mes-inscriptions'
 
     def __str__(self) -> str:
         """Represent using the project name, the year and the edition name."""
diff --git a/projects/templates/projects/organizers_participation_received.md b/projects/templates/projects/organizers_participation_received.md
index e3c715a..5b19339 100644
--- a/projects/templates/projects/organizers_participation_received.md
+++ b/projects/templates/projects/organizers_participation_received.md
@@ -3,5 +3,5 @@
 {% block body %}
 {{ user }} s'est inscrit à {{ edition }}.
 
-Vous pouvez télécharger la feuille des inscrits mise à jour sur [le site d'administration]({% url 'admin:projects_editionform_changelist' %}).
+Vous pouvez télécharger la feuille des inscrits mise à jour sur [le site d'administration](https://{{ request.get_host }}{% url 'admin:projects_editionform_changelist' %}).
 {% endblock %}
diff --git a/projects/templates/projects/participation_received.md b/projects/templates/projects/participation_received.md
index 9cb4bfa..37609f2 100644
--- a/projects/templates/projects/participation_received.md
+++ b/projects/templates/projects/participation_received.md
@@ -6,13 +6,14 @@ Tu as demandé t'inscrire à {{ edition }} via l'espace projets.
 Nous avons bien reçu ta demande et allons vérifier ton dossier dès que possible.
 
 {% if edition.edition_form.form.files.count %}
-**Rappel** : l'inscription à ce projet nécessite de fournir des documents complémentaires. 📖 Tu devras nous les faire parvenir **impérativement avant le {{ edition.edition_form.deadline | date }}** à l'adresse suivante :
+📖 **Rappel** : l'inscription à ce projet nécessite de fournir des documents complémentaires.
 
-**{{ edition.edition_form.recipient.user.get_full_name }}**
+🔗 Tu peux télécharger ces documents à tout moment en te rendant dans la section [Mes inscriptions]({{ edition.get_registration_url }}).
 
-{{ edition.edition_form.recipient.address }}
+Fais-nous parvenir ces documents **impérativement avant le {{ edition.edition_form.deadline | date }}** à l'adresse suivante :
 
-🔗 Tu peux télécharger ces documents à tout moment en te rendant dans la section [Mes inscriptions]({{ edition.get_registration_url }}).
+{{ edition.edition_form.recipient.user.get_full_name }}  
+{{ edition.edition_form.recipient.address }}
 
 ⚠️ Nous ne pourrons valider ton dossier qu'une fois ces documents reçus.
 {% endif %}
diff --git a/visits/models.py b/visits/models.py
index e8f7333..63fadd8 100644
--- a/visits/models.py
+++ b/visits/models.py
@@ -216,7 +216,7 @@ class Visit(models.Model):
 
     def get_site_url(self):
         site = Site.objects.get_current()
-        return f'http://{site.domain}/visits/{self.pk}'
+        return f'https://{site.domain}/visits/{self.pk}'
 
     def __str__(self):
         return str(self.title)
-- 
GitLab