Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
radiopanik
django-panik-newsletter
Commits
f565bab9
Commit
f565bab9
authored
Aug 30, 2019
by
fred
Browse files
1.11: use dictionary as context
parent
29ee9325
Changes
1
Hide whitespace changes
Inline
Side-by-side
newsletter/models.py
View file @
f565bab9
...
...
@@ -14,7 +14,7 @@ import html2text
from
django.db
import
models
from
django.core.urlresolvers
import
reverse
from
django.template
import
loader
,
Context
from
django.template
import
loader
,
from
django.template.loader
import
render_to_string
from
django.conf
import
settings
...
...
@@ -45,7 +45,7 @@ class Subscriber(models.Model) :
self
.
password
=
hashlib
.
sha1
(
str
(
random
.
random
())).
hexdigest
()
confirm_subject
=
loader
.
get_template
(
'newsletter/confirmation_email_subject.txt'
)
confirm_body
=
loader
.
get_template
(
'newsletter/confirmation_email_body.txt'
)
context
=
Context
(
{
'token'
:
self
.
password
}
)
context
=
{
'token'
:
self
.
password
}
send_mail
(
confirm_subject
.
render
(
context
).
strip
(),
confirm_body
.
render
(
context
),
settings
.
NEWSLETTER_SENDER
,
[
self
.
email
])
self
.
is_validated
=
False
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment