mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-15 08:17:08 +08:00
Change PasswordResetForm.get_users() to return Iterable, not Iterator. (#678)
This matches the actual implementation in Django, where it only attempts to use the result of get_users() in a for loop, which allows for any Iterable, and it provides a more flexible and idiomatic API for users who subclass PasswordResetForm.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Dict, Iterator, Optional
|
||||
from typing import Any, Dict, Iterable, Optional
|
||||
|
||||
from django import forms
|
||||
from django.contrib.auth.base_user import AbstractBaseUser
|
||||
@@ -53,7 +53,7 @@ class PasswordResetForm(forms.Form):
|
||||
to_email: str,
|
||||
html_email_template_name: Optional[str] = ...,
|
||||
) -> None: ...
|
||||
def get_users(self, email: str) -> Iterator[Any]: ...
|
||||
def get_users(self, email: str) -> Iterable[Any]: ...
|
||||
def save(
|
||||
self,
|
||||
domain_override: Optional[str] = ...,
|
||||
|
||||
Reference in New Issue
Block a user