Skip to content

Commit

Permalink
[#611] Obfuscate Emails
Browse files Browse the repository at this point in the history
Add the django-email-obfuscator library to obfuscate email addresses in
the site footer and Community detail pages.

Closes #611
  • Loading branch information
prikhi committed Sep 8, 2015
1 parent 9e02e8f commit 6d88578
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
Expand Up @@ -4,14 +4,14 @@

The `community` context variable is expected to be passed.
{% endcomment %}
{% load mezzanine_tags %}
{% load mezzanine_tags email_obfuscator %}

<dl class="dl-horizontal">
<!-- Email -->
{% if community.email %}
<dt>Email</dt>
<dd class="email"><a href="mailto:{{ community.email }}">
{{ community.email }}
<dd class="email"><a href="mailto:{{ community.email|obfuscate }}">
{{ community.email|obfuscate }}
</a></dd>
{% endif %}
<!-- Website -->
Expand Down
1 change: 1 addition & 0 deletions fec/fec/settings/base.py
Expand Up @@ -45,6 +45,7 @@ def get_env_variable(var_name):
"homepage",

"axes",
"email_obfuscator",

"django.contrib.admin",
"django.contrib.auth",
Expand Down
10 changes: 6 additions & 4 deletions fec/fec/templates/site.html
@@ -1,6 +1,6 @@
<!doctype html>
<html lang="{{ LANGUAGE_CODE }}"{% if LANGUAGE_BIDI %} dir="rtl"{% endif %}>
{% load communities_tags pages_tags mezzanine_tags i18n future staticfiles cache %}
{% load communities_tags pages_tags mezzanine_tags i18n future staticfiles cache email_obfuscator %}

<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
Expand Down Expand Up @@ -200,14 +200,16 @@
</div>
<div>
<!-- Contact & Report a Bug Links -->
<a href="mailto:secretary@thefec.org?subject=FEC%20Website%20Contact">
{% with "?subject=FEC%20Website%20Contact" as email_subject %}
<a href="mailto:{{ "secretary@thefec.org"|obfuscate }}{{ email_subject }}">
Secretary</a>
|
<a href="mailto:peachadmin@thefec.org?subject=FEC%20Website%20Contact">
<a href="mailto:{{ "peachadmin@thefec.org"|obfuscate }}{{ email_subject }}">
PEACH</a>
|
<a href="mailto:webmaster@thefec.org?subject=FEC%20Website%20Contact">
<a href="mailto:{{ "webmaster@thefec.org"|obfuscate }}{{ email_subject }}">
Webmaster</a>
{% endwith %}
</div>
<div>
<!-- Copyleft Year -->
Expand Down
1 change: 1 addition & 0 deletions requirements/base.txt
Expand Up @@ -6,5 +6,6 @@ python-memcached>=1.53

django_compressor>=1.4
django-axes>=1.4
django-email-obfuscator>=0.1.4

feedparser>=5.1

0 comments on commit 6d88578

Please sign in to comment.