repos
/ timestrap-django master

timestrap-django

mirror archived upstream

Time tracking you can host anywhere, built on Django. Full export support in multiple formats and easily extensible.

djangodockerhandcodedpythonself-hostedtime-trackingtimetracker

495 B · 17 lines · Python Raw History
 1from django.contrib.auth.forms import PasswordResetForm
 2
 3from conf.models import Site
 4from conf.utils import current_site_id
 5
 6
 7class TimestrapPasswordResetForm(PasswordResetForm):
 8    """
 9    Override the 'domain' and 'site_name' email context variables to use the
10    current site.
11    """
12
13    def save(self, **kwargs):
14        site = Site.objects.get(id=current_site_id())
15        kwargs["extra_email_context"] = {"domain": site.domain, "site_name": site.name}
16        super().save(**kwargs)