mirror of
https://github.com/zulip/zulip.git
synced 2025-10-25 00:53:56 +00:00
requirements: Upgrade Python requirements.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
7566e6549e
commit
acd7353538
@@ -2,7 +2,7 @@ import base64
|
||||
import logging
|
||||
import re
|
||||
from email.headerregistry import Address
|
||||
from typing import Any
|
||||
from typing import TYPE_CHECKING, Any, TypeAlias
|
||||
|
||||
import dns.resolver
|
||||
import orjson
|
||||
@@ -426,7 +426,16 @@ class CaptchaRealmCreationForm(RealmCreationForm):
|
||||
return payload
|
||||
|
||||
|
||||
class LoggingSetPasswordForm(SetPasswordForm):
|
||||
# https://github.com/typeddjango/django-stubs/pull/2384#pullrequestreview-2813849209
|
||||
if TYPE_CHECKING:
|
||||
BaseSetPasswordForm: TypeAlias = SetPasswordForm[UserProfile] # type: ignore[type-var] # we don't subclass AbstractUser
|
||||
else:
|
||||
BaseSetPasswordForm = SetPasswordForm
|
||||
|
||||
|
||||
class LoggingSetPasswordForm(
|
||||
BaseSetPasswordForm # type: ignore[type-var] # we don't subclass AbstractUser
|
||||
):
|
||||
new_password1 = forms.CharField(
|
||||
label=_("New password"),
|
||||
widget=forms.PasswordInput(attrs={"autocomplete": "new-password"}),
|
||||
@@ -452,7 +461,6 @@ class LoggingSetPasswordForm(SetPasswordForm):
|
||||
|
||||
@override
|
||||
def save(self, commit: bool = True) -> UserProfile:
|
||||
assert isinstance(self.user, UserProfile)
|
||||
do_change_password(self.user, self.cleaned_data["new_password1"], commit=commit)
|
||||
return self.user
|
||||
|
||||
|
||||
Reference in New Issue
Block a user