Skip to content

Commit

Permalink
Require logged in state for demographics view.
Browse files Browse the repository at this point in the history
  • Loading branch information
brunns committed Jul 25, 2024
1 parent d796090 commit 087b006
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import logging

from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin
from django.http import HttpRequest, HttpResponse
from django.shortcuts import redirect
from django.utils.decorators import method_decorator
Expand All @@ -23,7 +24,7 @@ def get(self, request: HttpRequest) -> HttpResponse:
return redirect("demographics")


class DemographicsView(UpdateView):
class DemographicsView(LoginRequiredMixin, UpdateView):
model = User
template_name = "demographics.html"
form_class = DemographicsForm
Expand Down

0 comments on commit 087b006

Please sign in to comment.