Skip to content

Commit

Permalink
Fix minor bugs
Browse files Browse the repository at this point in the history
- Fix bug in context_processors when user not authenticated
- Add healthcheck url
  • Loading branch information
michaeljcollinsuk committed Jul 10, 2024
1 parent 7e0e82b commit 4a519ae
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ap/core/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def header_context(request):
return {
"header_nav_items": [
{
"name": request.user.name,
"name": request.user.name if is_logged_in else "",
"url": "",
},
{
Expand Down
1 change: 1 addition & 0 deletions ap/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
path("", views.IndexView.as_view(), name="index"),
path("auth/", include("ap.auth.urls")),
path("admin/", admin.site.urls),
path("healthcheck/", views.HealthcheckView.as_view(), name="healthcheck"),
]
7 changes: 7 additions & 0 deletions ap/views.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
from django.http import HttpResponse
from django.views import View
from django.views.generic import TemplateView

from ap.auth.views.mixins import OIDCLoginRequiredMixin


class IndexView(OIDCLoginRequiredMixin, TemplateView):
template_name = "home.html"


class HealthcheckView(View):
def get(self, request):
return HttpResponse("OK")

0 comments on commit 4a519ae

Please sign in to comment.