From 84cdaff67db6d520eb5abf8f59bbe015f5ab18ae Mon Sep 17 00:00:00 2001
From: Flavio Tarsetti <flavio.tarsetti@idiap.ch>
Date: Mon, 16 Mar 2020 16:51:31 +0100
Subject: [PATCH] [settings/ui][settings/templates-views] Fix issue with
 documentation pointers

Fixes #545
---
 beat/web/settings/settings.py                               | 1 +
 .../templates/registration/registration_form.html           | 6 +++---
 beat/web/ui/registration/views.py                           | 1 +
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/beat/web/settings/settings.py b/beat/web/settings/settings.py
index 5f86463e3..e66f581e5 100755
--- a/beat/web/settings/settings.py
+++ b/beat/web/settings/settings.py
@@ -435,3 +435,4 @@ SERIALIZATION_MODULES = {"json": "beat.web.utils.activity_stream_serializer"}
 ##############################################################################
 
 DOCUMENTATION_LINK = "https://www.idiap.ch/software/beat/docs/beat/docs/stable/beat.web/doc/user/index.html"
+DOCUMENTATION_FAQ_LINK = "https://www.idiap.ch/software/beat/docs/beat/docs/stable/beat.web/doc/user/faq.html"
diff --git a/beat/web/ui/registration/templates/registration/registration_form.html b/beat/web/ui/registration/templates/registration/registration_form.html
index e08b5fb04..1c6c53835 100644
--- a/beat/web/ui/registration/templates/registration/registration_form.html
+++ b/beat/web/ui/registration/templates/registration/registration_form.html
@@ -115,7 +115,7 @@
                     {% endfor %}
                     <div class="alert alert-warning" role="alert">Your account needs to
                       be validated by a recognized person on the platform. This recognized
-                      person is known as a <a href="{{url_prefix}}/static/guide/faq.html#what-is-a-supervisor"> supervisor</a>.
+                      person is known as a <a href="{{documentation_faq_link}}#what-is-a-supervisor"> supervisor</a>.
                       If you wish to become a supervisor, please follow the <a href="{% url 'contact' %}">contact information</a>.
                     </div>
                   </div>
@@ -157,8 +157,8 @@
                   <div class="alert alert-danger" role="alert">{{ error }}</div>
                   {% endfor %}
 
-                  <div class="alert alert-warning" role="alert">By requesting a <a href="{{url_prefix}}/static/guide/faq.html#what-is-a-supervisor"> supervisor</a>
-                    account you acknowledge that you hold a position in a research laboratory. In order to become a recognized person on the platform your profile
+                  <div class="alert alert-warning" role="alert">By requesting a <a href="{{documentation_faq_link}}#what-is-a-supervisor"> supervisor</a>
+                    account you acknowledge that you hold a permanent position in a research laboratory. In order to become a recognized person on the platform your profile
                     will be checked by the administrators of the platform.
                   </div>
 
diff --git a/beat/web/ui/registration/views.py b/beat/web/ui/registration/views.py
index 183f38831..0e29e105b 100644
--- a/beat/web/ui/registration/views.py
+++ b/beat/web/ui/registration/views.py
@@ -199,6 +199,7 @@ def register(request, success_url=None,
     context = { 'form': form,
                 'form_supervisor': form_supervisor,
                 'supervisor_form_active': supervisor_form_active,
+                'documentation_faq_link': settings.DOCUMENTATION_FAQ_LINK,
                 'url_prefix':settings.URL_PREFIX }
 
     if extra_context is not None:
-- 
GitLab