Skip to content

Commit

Permalink
Remove useless .is_authenticated
Browse files Browse the repository at this point in the history
Since #5178, views are *protected* by default.
  • Loading branch information
EwenKorr committed Jan 8, 2025
1 parent 5c9b3d4 commit 6840f5f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion itou/www/apply/views/submit_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def setup(self, request, *args, **kwargs):
self.sender = request.user

def dispatch(self, request, *args, **kwargs):
if self.sender.is_authenticated and self.sender.kind not in [UserKind.PRESCRIBER, UserKind.EMPLOYER]:
if self.sender.kind not in [UserKind.PRESCRIBER, UserKind.EMPLOYER]:
logger.info(f"dispatch ({request.path}) : {self.sender.kind} in sender tunnel")
return HttpResponseRedirect(reverse("apply:start", kwargs={"company_pk": self.company.pk}))
return super().dispatch(request, *args, **kwargs)
Expand Down
2 changes: 1 addition & 1 deletion itou/www/job_seekers_views/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ def setup(self, request, *args, **kwargs):
self.sender = request.user

def dispatch(self, request, *args, **kwargs):
if self.sender.is_authenticated and self.sender.kind not in [UserKind.PRESCRIBER, UserKind.EMPLOYER]:
if self.sender.kind not in [UserKind.PRESCRIBER, UserKind.EMPLOYER]:
logger.info(f"dispatch ({request.path}) : {self.sender.kind} in sender tunnel")
return HttpResponseRedirect(reverse("apply:start", kwargs={"company_pk": self.company.pk}))
return super().dispatch(request, *args, **kwargs)
Expand Down

0 comments on commit 6840f5f

Please sign in to comment.