mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2024-11-22 09:36:52 +03:00
Add type guard
This commit is contained in:
parent
a8105bdc9f
commit
6355464230
|
@ -35,6 +35,8 @@ class UserUpdateView(LoginRequiredMixin, SuccessMessageMixin, UpdateView):
|
|||
return self.request.user.get_absolute_url()
|
||||
|
||||
def get_object(self, queryset: QuerySet | None=None) -> User:
|
||||
# for mypy to know that the user is authenticated
|
||||
assert self.request.user.is_authenticated
|
||||
return self.request.user
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user