def check_password(environ, username, password):
 UserModel = auth.get_user_model()
 db.reset_queries()
 try:
  try:
   user = UserModel._default_manager.get_by_natural_key(username)
  except UserModel.DoesNotExist:
   return None
  if (not user.is_active):
   return None
  return user.check_password(password)
 finally:
  db.close_old_connections()

def check_password ( environ , username , password ) : UserModel = auth . get_user_model ( ) db . reset_queries ( ) try : try : user = UserModel . _default_manager . get_by_natural_key ( username ) except UserModel . DoesNotExist : return None if ( not user . is_active ) : return None return user . check_password ( password ) finally : db . close_old_connections ( )
check that a plaintext password matches hashed .