Refactor: split code into several django apps (we call them modules).

This commit is contained in:
2018-12-13 14:47:58 +01:00
parent c23dc33d4e
commit 0d5a8c65e3
81 changed files with 739 additions and 332 deletions

25
dav_auth/emails.py Normal file
View File

@@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
from dav_base.emails import AbstractMail
class PasswordSetEmail(AbstractMail):
_subject = u'Zugangsdaten'
_template_name = 'dav_auth/emails/password_set.txt'
def __init__(self, user, password):
self._user = user
self._password = password
def _get_recipients(self):
r = u'{fullname} <{email}>'.format(fullname=self._user.get_full_name(),
email=self._user.email)
return [r]
def _get_context_data(self, extra_context=None):
context = super(PasswordSetEmail, self)._get_context_data(extra_context=extra_context)
context.update({
'fullname': self._user.get_full_name(),
'username': self._user.username,
'password': self._password
})
return context