Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
django-panik-newsletter
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
radiopanik
django-panik-newsletter
Commits
2a8c358d
Commit
2a8c358d
authored
Dec 29, 2019
by
fred
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
always pass bytes to hashlib
parent
98b133a2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
newsletter/models.py
newsletter/models.py
+2
-1
No files found.
newsletter/models.py
View file @
2a8c358d
...
...
@@ -18,6 +18,7 @@ from django.template import loader
from
django.template.loader
import
render_to_string
from
django.conf
import
settings
from
django.utils.encoding
import
force_bytes
from
django.utils.safestring
import
mark_safe
from
django.utils.translation
import
ugettext
from
django.utils.translation
import
ugettext_lazy
as
_
...
...
@@ -42,7 +43,7 @@ class Subscriber(models.Model) :
self
.
send_confirmation_email
()
def
send_confirmation_email
(
self
):
self
.
password
=
hashlib
.
sha1
(
str
(
random
.
random
(
))).
hexdigest
()
self
.
password
=
hashlib
.
sha1
(
force_bytes
(
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
=
{
'token'
:
self
.
password
}
...
...
Write
Preview
Markdown
is supported
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