Skip to content

Commit

Permalink
Merge pull request #859 from i-dot-ai/bugfix/REDBOX-534-require-logge…
Browse files Browse the repository at this point in the history
…d-in-state-for-demographics-view

REDBOX-534 - Require logged in state for demographics view.
  • Loading branch information
brunns authored Jul 25, 2024
2 parents 9d6f302 + 087b006 commit ea345d0
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 ea345d0

Please sign in to comment.