models: Add RealmReactivationStatus to ConfirmObjT.

We added RealmReactivationStatus as a possible confirmation object
in #22584. We also need to add this type to ConfirmationObjT.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
This commit is contained in:
Zixuan James Li 2022-07-27 16:04:14 -04:00 committed by Tim Abbott
parent 43213ea37b
commit ed77684427
1 changed files with 16 additions and 2 deletions

View File

@ -19,7 +19,14 @@ from django.utils.timezone import now as timezone_now
from confirmation import settings as confirmation_settings from confirmation import settings as confirmation_settings
from zerver.lib.types import UnspecifiedValue from zerver.lib.types import UnspecifiedValue
from zerver.models import EmailChangeStatus, MultiuseInvite, PreregistrationUser, Realm, UserProfile from zerver.models import (
EmailChangeStatus,
MultiuseInvite,
PreregistrationUser,
Realm,
RealmReactivationStatus,
UserProfile,
)
class ConfirmationKeyException(Exception): class ConfirmationKeyException(Exception):
@ -47,7 +54,14 @@ def generate_key() -> str:
return b32encode(secrets.token_bytes(15)).decode().lower() return b32encode(secrets.token_bytes(15)).decode().lower()
ConfirmationObjT = Union[MultiuseInvite, PreregistrationUser, EmailChangeStatus, UserProfile, Realm] ConfirmationObjT = Union[
MultiuseInvite,
PreregistrationUser,
EmailChangeStatus,
UserProfile,
Realm,
RealmReactivationStatus,
]
def get_object_from_key( def get_object_from_key(