10000 Add a DEJACODE_SUPPORT_EMAIL setting by tdruez · Pull Request #80 · aboutcode-org/dejacode · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add a DEJACODE_SUPPORT_EMAIL setting #80

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

10000 Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ Release notes
- Add a vulnerability link to the VulnerableCode app in the Vulnerability tab.
https://github.com/nexB/dejacode/issues/4

- Add a DEJACODE_SUPPORT_EMAIL setting for support email address customization.
https://github.com/nexB/dejacode/issues/76

### Version 5.0.1

- Improve the stability of the "Check for new Package versions" feature.
Expand Down
3 changes: 3 additions & 0 deletions dejacode/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,9 @@ def gettext_noop(s):
DEFAULT_FROM_EMAIL = env.str("DEFAULT_FROM_EMAIL", default="")
EMAIL_USE_TLS = env.bool("EMAIL_USE_TLS", default=True)

# An email address displayed in UI for users to reach the support team.
DEJACODE_SUPPORT_EMAIL = env.str("DEJACODE_SUPPORT_EMAIL", default="")

# Enable this setting to display a "Tools" section in the navbar including
# links to the "Requests" and "Reporting" views.
SHOW_TOOLS_IN_NAV = env.bool("SHOW_TOOLS_IN_NAV", default=True)
Expand Down
1 change: 1 addition & 0 deletions dje/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ def dejacode_context(request):
"""Return all the DejaCode specific context variables."""
return {
"DEJACODE_VERSION": DEJACODE_VERSION,
"DEJACODE_SUPPORT_EMAIL": settings.DEJACODE_SUPPORT_EMAIL,
"FAVICON_HREF": settings.FAVICON_HREF,
"SITE_TITLE": settings.SITE_TITLE,
"HEADER_TEMPLATE": settings.HEADER_TEMPLATE,
Expand Down
4 changes: 3 additions & 1 deletion dje/templates/axes_lockout.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
{% include 'includes/header_title.html' with title="Account locked" %}
<p>
Your account is locked following too many failed login attempts.<br>
Contact the DejaCode support team at <a href="mailto:support@dejacode.com">support@dejacode.com</a> to unlock your account.
{% if DEJACODE_SUPPORT_EMAIL %}
Contact the DejaCode support team at <a href="mailto:{{ DEJACODE_SUPPORT_EMAIL }}">{{ DEJACODE_SUPPORT_EMAIL }}</a> to unlock your account.
{% endif %}
</p>
{% endblock %}
5 changes: 4 additions & 1 deletion dje/templates/django_registration/activation_email_body.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ https://{{ site }}{% url 'django_registration_activate' activation_key %}

If you cannot click on the link, please copy it to your browser.

Please note that you have {{ expiration_days }} days to activate your account. After this delay, please contact us at support@dejacode.com and we will send you a new activation link.
Please note that you have {{ expiration_days }} days to activate your account.
{% if DEJACODE_SUPPORT_EMAIL %}
After this delay, please contact us at {{ DEJACODE_SUPPORT_EMAIL }} and we will send you a new activation link.
{% endif %}

Thank You,

Expand Down
7 changes: 5 additions & 2 deletions dje/templates/django_registration/activation_failed.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
{% include 'includes/header_title.html' with pretitle='Account' title='Error during your account activation' %}
<p>
{{ activation_error.message }}
<br><br>
If the problem persists, send us an email at <a href="mailto:support@dejacode.com">support@dejacode.com</a>
</p>
{% if DEJACODE_SUPPORT_EMAIL %}
<p>
If the problem persists, send us an email at <a href="mailto:{{ DEJACODE_SUPPORT_EMAIL }}">{{ DEJACODE_SUPPORT_EMAIL }}</a>
</p>
{% endif %}
{% endblock %}
8 changes: 5 additions & 3 deletions dje/templates/django_registration/registration_closed.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@

{% block content %}
{% include 'includes/header_title.html' with pretitle='Account' title='The DejaCode registration is currently closed' %}
<p>
Send us an email at <a href="mailto:support@dejacode.com">support@dejacode.com</a> for any question.
</p>
{% if DEJACODE_SUPPORT_EMAIL %}
<p>
Send us an email at <a href="mailto:{{ DEJACODE_SUPPORT_EMAIL }}">{{ DEJACODE_SUPPORT_EMAIL }}</a> for any question.
</p>
{% endif %}
{% endblock %}
8 changes: 5 additions & 3 deletions dje/templates/registration/password_reset_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@
{% endif %}
</div>
<button class="btn btn-outline-dark" type="submit">{% trans 'Change my password' %}</button>
<p class="mt-4">
Has your e-mail address changed? If you no longer use the e-mail address associated with your DejaCode account, you may contact our <a href="mailto:support@dejacode.com">customer service</a> for help restoring access to your account.
</p>
{% if DEJACODE_SUPPORT_EMAIL %}
<p class="mt-4">
Has your e-mail address changed? If you no longer use the e-mail address associated with your DejaCode account, you may contact our <a href="mailto:{{ DEJACODE_SUPPORT_EMAIL }}">customer service</a> for help restoring access to your account.
</p>
{% endif %}
</div>
</div>
</form>
Expand Down
11 changes: 11 additions & 0 deletions docs/application-settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,17 @@ notifications.

SITE_URL=http://www.yourdomain.com/

DEJACODE_SUPPORT_EMAIL
----------------------

An optional email address to reach the support team of this instance.
When defined, it will be displayed in various views and emails related to account
registration, activation, and password reset.

.. code-block:: python

DEJACODE_SUPPORT_EMAIL=support@dejacode.com

ANONYMOUS_USERS_DATASPACE
-------------------------

Expand Down
0