def base_save(
            self, domain_override=None,
            subject_template_name='registration/password_reset_subject.txt',
            email_template_name='registration/password_reset_email.html',
            use_https=False, token_generator=default_token_generator,
            from_email=None, request=None, html_email_template_name=None):
        from django.core.mail import send_mail
        from django.contrib.auth import get_user_model
        from django.contrib.sites.models import get_current_site
        from django.template import loader
        from django.utils.encoding import force_bytes
        from django.utils.http import urlsafe_base64_encode

        UserModel = get_user_model()
        email = self.cleaned_data["email"]
        active_users = UserModel._default_manager.filter(
            email__iexact=email,
            # we use "deleted" instead of "is_active"
            deleted=False)

        for user in active_users:
            # Make sure that no email is sent to a user that actually has
            # a password marked as unusable
            if not user.has_usable_password():
                continue
            if not domain_override:
                current_site = get_current_site(request)
                site_name = current_site.name
                domain = current_site.domain
            else:
                site_name = domain = domain_override
            c = {
                'email': user.email,
                'domain': domain,
                'site_name': site_name,
                'uid': urlsafe_base64_encode(force_bytes(user.pk)),
                'user': user,
                'token': token_generator.make_token(user),
                'protocol': 'https' if use_https else 'http',
            }
            subject = loader.render_to_string(subject_template_name, c)
            # Email subject *must not* contain newlines
            subject = ''.join(subject.splitlines())
            email = loader.render_to_string(email_template_name, c)

            if html_email_template_name:
                html_email = loader.render_to_string(
                    html_email_template_name, c)
            else:
                html_email = None
            send_mail(
                subject, email, from_email, [user.email],
                html_message=html_email)
Generates a one-use only link for resetting password and sends to the
dataset/ETHPy150Open mozilla/addons-server/src/olympia/users/forms.py/PasswordResetForm.base_save