-
Notifications
You must be signed in to change notification settings - Fork 5
/
fieldsetup.py
49 lines (44 loc) · 1.3 KB
/
fieldsetup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
from collections import namedtuple
from . import settings
class VerifiedEmailFieldSetup(
namedtuple(
"VerifiedEmailFieldSetup",
(
"cache_prefix",
"code_length",
"code_ttl",
"mail_from",
"mail_subject",
"mail_template_txt",
"mail_template_html",
"mail_context",
"mail_mailer",
),
)
):
def __new__(
cls,
cache_prefix=settings.CACHE_PREFIX,
code_length=settings.CODE_LENGTH,
code_ttl=settings.CODE_TTL,
mail_from=settings.MAIL_FROM,
mail_subject=settings.MAIL_SUBJECT,
mail_template_txt=settings.MAIL_TEMPLATE_TXT,
mail_template_html=settings.MAIL_TEMPLATE_HTML,
mail_context=None,
mail_mailer=settings.MAIL_MAILER,
**kwargs
):
return super(VerifiedEmailFieldSetup, cls).__new__(
cls,
cache_prefix=cache_prefix,
code_length=code_length,
code_ttl=code_ttl,
mail_from=mail_from,
mail_subject=mail_subject,
mail_template_txt=mail_template_txt,
mail_template_html=mail_template_html,
mail_context=mail_context or {},
mail_mailer=mail_mailer,
)
fieldsetups = {}