MCPcopy
hub / github.com/django/django / get_users

Method get_users

django/contrib/auth/forms.py:423–442  ·  view source on GitHub ↗

Given an email, return matching user(s) who should receive a reset. This allows subclasses to more easily customize the default policies that prevent inactive users and users with unusable passwords from resetting their password.

(self, email)

Source from the content-addressed store, hash-verified

421 )
422
423 def get_users(self, email):
424 """Given an email, return matching user(s) who should receive a reset.
425
426 This allows subclasses to more easily customize the default policies
427 that prevent inactive users and users with unusable passwords from
428 resetting their password.
429 """
430 email_field_name = UserModel.get_email_field_name()
431 active_users = UserModel._default_manager.filter(
432 **{
433 "%s__iexact" % email_field_name: email,
434 "is_active": True,
435 }
436 )
437 return (
438 u
439 for u in active_users
440 if u.has_usable_password()
441 and _unicode_ci_compare(email, getattr(u, email_field_name))
442 )
443
444 def save(
445 self,

Callers 1

saveMethod · 0.95

Calls 4

_unicode_ci_compareFunction · 0.85
get_email_field_nameMethod · 0.80
has_usable_passwordMethod · 0.80
filterMethod · 0.45

Tested by

no test coverage detected