mirror of https://github.com/zulip/zulip.git
send_password_reset_email: Narrow type of users.
5a32ea52ae
changed the return type of `get_users`, enabling this.
This commit is contained in:
parent
bafea0e7be
commit
6635f3ea12
|
@ -1,8 +1,9 @@
|
|||
from argparse import ArgumentParser
|
||||
from typing import Any, Iterable
|
||||
from typing import Any
|
||||
|
||||
from django.contrib.auth.tokens import default_token_generator
|
||||
from django.core.management.base import CommandError
|
||||
from django.db.models import QuerySet
|
||||
from typing_extensions import override
|
||||
|
||||
from zerver.forms import generate_password_reset_url
|
||||
|
@ -29,7 +30,7 @@ class Command(ZulipBaseCommand):
|
|||
@override
|
||||
def handle(self, *args: Any, **options: str) -> None:
|
||||
if options["entire_server"]:
|
||||
users: Iterable[UserProfile] = UserProfile.objects.filter(
|
||||
users: QuerySet[UserProfile] = UserProfile.objects.filter(
|
||||
is_active=True, is_bot=False, is_mirror_dummy=False
|
||||
)
|
||||
else:
|
||||
|
@ -45,7 +46,7 @@ class Command(ZulipBaseCommand):
|
|||
|
||||
self.send(users)
|
||||
|
||||
def send(self, users: Iterable[UserProfile]) -> None:
|
||||
def send(self, users: QuerySet[UserProfile]) -> None:
|
||||
"""Sends one-use only links for resetting password to target users"""
|
||||
for user_profile in users:
|
||||
context = {
|
||||
|
|
Loading…
Reference in New Issue