mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-01-25 00:34:18 +03:00
Merge pull request #3012 from Andrew-Chen-Wang/patch-8
Use self.request.user instead of second query
This commit is contained in:
commit
4299f43abd
|
@ -27,7 +27,7 @@ class UserUpdateView(LoginRequiredMixin, UpdateView):
|
|||
return reverse("users:detail", kwargs={"username": self.request.user.username})
|
||||
|
||||
def get_object(self):
|
||||
return User.objects.get(username=self.request.user.username)
|
||||
return self.request.user
|
||||
|
||||
def form_valid(self, form):
|
||||
messages.add_message(
|
||||
|
|
Loading…
Reference in New Issue
Block a user