Skip to content

Commit

Permalink
Merge pull request #37 from javier-a-agustin/overwrite-display-messag…
Browse files Browse the repository at this point in the history
…e-template

Add DISPLAY_MESSAGE setting
  • Loading branch information
foo290 committed Apr 12, 2022
2 parents dfaa38e + 9f4c551 commit fbfe456
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.vscode/
.idea/
test_installer/
test_installer/
__pycache__
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,8 @@ VERIFICATION_FAILED_TEMPLATE = "path/to/failed.html"
REQUEST_NEW_EMAIL_TEMPLATE = "path/to/email.html"
LINK_EXPIRED_TEMPLATE = 'path/to/expired.html'
NEW_EMAIL_SENT_TEMPLATE = 'path/to/new_email_sent.html'
```
```
SUBJECT = 'subject of email'
Expand Down
4 changes: 4 additions & 0 deletions verify_email/app_configurations.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ def __init__(self):
'REQUEST_NEW_EMAIL_TEMPLATE',
'verify_email/request_new_email.html'
),
'new_email_sent_template': (
'NEW_EMAIL_SENT_TEMPLATE',
'verify_email/new_email_sent.html'
),

'salt': (
'HASH_SALT',
Expand Down
5 changes: 3 additions & 2 deletions verify_email/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
success_template = pkg_configs.get('verification_success_template')
link_expired_template = pkg_configs.get('link_expired_template')
request_new_email_template = pkg_configs.get('request_new_email_template')
new_email_sent_template = pkg_configs.get('new_email_sent_template')


def verify_user_and_activate(request, useremail, usertoken):
Expand Down Expand Up @@ -129,7 +130,7 @@ def request_new_link(request, useremail=None, usertoken=None):
if status:
return render(
request,
template_name='verify_email/display_message.html',
template_name=new_email_sent_template,
context={
'msg': "You have requested another verification email!",
'minor_msg': 'Your verification link has been sent',
Expand All @@ -152,7 +153,7 @@ def request_new_link(request, useremail=None, usertoken=None):
if status:
return render(
request,
template_name='verify_email/display_message.html',
template_name=new_email_sent_template,
context={
'msg': "You have requested another verification email!",
'minor_msg': 'Your verification link has been sent',
Expand Down

0 comments on commit fbfe456

Please sign in to comment.