diff --git a/templates/form.html b/templates/form.html
index 3efb308..50beb78 100644
--- a/templates/form.html
+++ b/templates/form.html
@@ -52,7 +52,7 @@ $(document).ready(function () {
function SearchLDAP(event) {
let current_val = $('#NETBADGEID').val();
- let url = {{ base_href }} + "/search_ldap/" + current_val;
+ let url = "{{base_href}}/search_ldap/" + current_val;
$.ajax({
url: url,
diff --git a/templates/index.html b/templates/index.html
index 8ec3a82..9abf26d 100644
--- a/templates/index.html
+++ b/templates/index.html
@@ -59,9 +59,9 @@
function selectStudies() {
let uva_id = document.getElementById('uva_id').value;
if (uva_id == 'all') {
- window.location.href = '/'
+ window.location.href = "{{base_href}}/";
} else {
- window.location.href = "/user_studies/" + uva_id;
+ window.location.href = "{{base_href}}/user_studies/" + uva_id;
}
}
diff --git a/tests/test_sanity.py b/tests/test_sanity.py
index e5c10d7..5250219 100644
--- a/tests/test_sanity.py
+++ b/tests/test_sanity.py
@@ -152,12 +152,12 @@ class Sanity_Check_Test(unittest.TestCase):
self.assertEqual('308 PERMANENT REDIRECT', studies1.status)
for header in studies1.headers:
if header[0] == 'Location':
- self.assertEqual('http://localhost/user_studies/', header[1])
+ self.assertIn('user_studies', header[1])
studies2 = self.app.get(f'/user_studies/')
self.assertEqual('302 FOUND', studies2.status)
for header in studies2.headers:
if header[0] == 'Location':
- self.assertEqual('http://localhost/', header[1])
+ self.assertNotIn('user_studies', header[1])
def test_long_study_name(self):
title = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla egestas quam id ullamcorper facilisis. Praesent ultricies urna malesuada velit ultricies efficitur. Nam eu eleifend libero. Mauris ac erat augue. Curabitur ac fringilla tellus. Morbi sem quam, consectetur sit amet eros non, semper congue metus. Sed sollicitudin augue eu justo fermentum volutpat at sit amet metus. Vestibulum hendrerit pharetra ante. Sed porttitor diam nibh, quis elementum est placerat sit amet. Phasellus magna libero, porta quis euismod et, commodo eu nisl. Quisque consectetur sagittis interdum. Nullam congue consectetur elementum. In hac habitasse platea dictumst. Duis placerat iaculis odio, ac faucibus felis vehicula nec. Praesent cursus id turpis ac maximus.'