Merge branch 'kerl/fix_bds_production_urls' into 'master'

Hotfixes appliqués en production pour GestioBDS

See merge request klub-dev-ens/gestioCOF!484
This commit is contained in:
Ludovic Stephan 2021-02-18 17:02:21 +01:00
commit 8bf7914728
3 changed files with 19 additions and 7 deletions

View file

@ -34,7 +34,7 @@
<br>
<br>
<a class=button href="{% url 'export.members' %}">Télécharger la liste des membres (CSV)</a>
<a class=button href="{% url 'bds:export.members' %}">Télécharger la liste des membres (CSV)</a>
<br>
<br>

View file

@ -22,6 +22,16 @@ def login_url(next=None):
return "{}?next={}".format(login_url, next)
class TestHomeView(TestCase):
@mock.patch("gestioncof.signals.messages")
def test_get(self, mock_messages):
user = User.objects.create_user(username="random_user")
give_bds_buro_permissions(user)
self.client.force_login(user)
resp = self.client.get(reverse("bds:home"))
self.assertEquals(resp.status_code, 200)
class TestRegistrationView(TestCase):
@mock.patch("gestioncof.signals.messages")
def test_get_autocomplete(self, mock_messages):

View file

@ -8,20 +8,22 @@ from django.contrib import admin
from django.urls import include, path
from django.views.generic.base import RedirectView
bds_is_alone = (
"bds" in settings.INSTALLED_APPS and "gestioncof" not in settings.INSTALLED_APPS
)
admin.autodiscover()
urlpatterns = [
# Redirection / → /gestion, only useful for developpers.
path("", RedirectView.as_view(url="gestion/")),
# Website administration (independent from installed apps)
path("admin/doc/", include("django.contrib.admindocs.urls")),
path("admin/", admin.site.urls),
]
# App-specific urls
if not bds_is_alone:
# Redirection / → /gestion, only useful for developpers.
urlpatterns.append(path("", RedirectView.as_view(url="gestion/")))
bds_is_alone = (
"bds" in settings.INSTALLED_APPS and "gestioncof" not in settings.INSTALLED_APPS
)
# App-specific urls
app_dict = {
"bds": "" if bds_is_alone else "bds/",