admin: fix error when creating password-reset link

This commit is contained in:
Jens Langhammer 2020-11-21 16:23:39 +01:00
parent 49397cef70
commit 92c0ad4154
1 changed files with 1 additions and 1 deletions

View File

@ -155,7 +155,7 @@ class UserPasswordResetView(LoginRequiredMixin, PermissionRequiredMixin, DetailV
def get(self, request: HttpRequest, *args, **kwargs) -> HttpResponse:
"""Create token for user and return link"""
super().get(request, *args, **kwargs)
token, _ = Token.objects.get_or_create(
token, __ = Token.objects.get_or_create(
identifier="password-reset-temp", user=self.object
)
querystring = urlencode({"token": token.key})