Skip to content

Commit

Permalink
Refine
Browse files Browse the repository at this point in the history
  • Loading branch information
wlorenzetti committed Sep 22, 2023
1 parent 67cfe98 commit 1809069
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 4 deletions.
6 changes: 6 additions & 0 deletions g3w-admin/base/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,16 @@
ACCOUNT_ACTIVATION_DAYS = 2
REGISTRATION_OPEN = False

REGISTRATION_EMAIL_SUBJECT_PREFIX = '[G3W-SUITE]'
REGISTRATION_EMAIL_BODY_SIGN = '''
g3wsuite.it
'''

# Set to true if the activation of a registered user
# must be done by the administrator
REGISTRATION_ACTIVE_BY_ADMIN = False


# QPLOTLY DEFAULT SETTINGS
# ------------------------

Expand Down
12 changes: 12 additions & 0 deletions g3w-admin/templates/registration/password_reset_email.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{% load i18n %}{% autoescape off %}
{% blocktranslate %}You're receiving this email because you requested a password reset for your user account at {{ site_name }}.{% endblocktranslate %}

{% translate "Please go to the following page and choose a new password:" %}
{% block reset_link %}
{{ protocol }}://{{ domain }}{% url 'password_reset_confirm' uidb64=uid token=token %}
{% endblock %}
{% translate 'Your username, in case you’ve forgotten:' %} {{ user.get_username }}

{{ SETTINGS.REGISTRATION_EMAIL_BODY_SIGN }}

{% endautoescape %}
3 changes: 3 additions & 0 deletions g3w-admin/templates/registration/password_reset_subject.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{% load i18n %}{% autoescape off %}
{{ SETTINGS.REGISTRATION_EMAIL_SUBJECT_PREFIX}} {% blocktranslate %}Password reset on {{ site_name }}{% endblocktranslate %}
{% endautoescape %}
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ Now you can make the login!

{{ scheme }}://{{ site }}{% url 'login' %}

{{ SETTINGS.REGISTRATION_EMAIL_BODY_SIGN }}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[G3W-SUITE] {{user.username}} your profile is active.
{{ SETTINGS.REGISTRATION_EMAIL_SUBJECT_PREFIX }} {{user.username}} your account is active.
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ a new user has registered, to activate the new user, follow or copy the link in

{{ scheme }}://{{ site }}{% url 'user-update' user.pk %}

{{ SETTINGS.REGISTRATION_EMAIL_BODY_SIGN }}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[G3W-SUITE] New registration by {{user.username}}
{{ SETTINGS.REGISTRATION_EMAIL_SUBJECT_PREFIX }} New registration by {{user.username}}
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ please got to the following link or copy it and paste in you browser to activate

{{ scheme }}://{{ site }}{% url 'django_registration_activate' activation_key %}

The link will be active for {{ expiration_days }} days!
The link will be active for {{ expiration_days }} days!

{{ SETTINGS.REGISTRATION_EMAIL_BODY_SIGN }}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[G3W-SUITE] {{user.username}} complete your registration
{{ SETTINGS.REGISTRATION_EMAIL_SUBJECT_PREFIX }} {{user.username}} active your account
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,19 @@
{% block login_page_box_body %}
<div class="register-box-body">
<h4 style="text-align: center">{% trans 'Registration complete!' %}</h4>
{% if SETTINGS.REGISTRATION_ACTIVE_BY_ADMIN %}
<p class="register-box-msg">
{% blocktrans %}
Your registration is being examined by the administrators, once your account
is activated you will receive an activation confirmation email.
{% endblocktrans %}
</p>
{% else %}
<p class="register-box-msg">
{% blocktrans %}
You will receive a mail with a link to activate you account and validate your email.
{% endblocktrans %}
</p>
{% endif %}
</div><!-- /.login-box-body -->
{% endblock %}

0 comments on commit 1809069

Please sign in to comment.