I am thinking of adding simply domain_override = None as new class
attribute and adding it to opts:
{{{
class PasswordResetView(PasswordContextMixin, FormView):
...
domain_override = None
def form_valid(self, form):
opts = {
'use_https': self.request.is_secure(),
'token_generator': self.token_generator,
'from_email': self.from_email,
'email_template_name': self.email_template_name,
'subject_template_name': self.subject_template_name,
'request': self.request,
'html_email_template_name': self.html_email_template_name,
'extra_email_context': self.extra_email_context,
'domain_override': self.domain_override,
}
form.save(**opts)
return super().form_valid(form)
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/30499>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => assigned
* owner: nobody => Mattia Procopio
--
Ticket URL: <https://code.djangoproject.com/ticket/30499#comment:1>
* stage: Unreviewed => Accepted
Comment:
OK, yes, it seems a reasonable addition.
--
Ticket URL: <https://code.djangoproject.com/ticket/30499#comment:2>
* has_patch: 0 => 1
Comment:
[https://github.com/django/django/pull/11406 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/30499#comment:3>
* status: assigned => closed
* resolution: => invalid
Comment:
Mattia, Thanks for your work and sorry, but `domain` can be override
easily with the current implementation, e.g.
{{{
views.PasswordResetView.as_view(extra_email_context={'domain':
'custom.example.com'}).
}}}
I think that providing an extra `kwargs` for that is pointless.
--
Ticket URL: <https://code.djangoproject.com/ticket/30499#comment:4>