]> git.parisson.com Git - mezzo.git/commitdiff
Add spam filter
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Wed, 9 Nov 2016 15:40:53 +0000 (16:40 +0100)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Wed, 9 Nov 2016 15:40:53 +0000 (16:40 +0100)
app/organization/core/templatetags/organization_tags.py
app/templates/network/person_detail.html

index e232532ef107bde3ab491407f9edb6a9409554e8..e0603b4bf94dbe99ecb6e57a983a9d629eecb24b 100644 (file)
@@ -170,3 +170,7 @@ def current_year():
 @register.filter
 def is_not_host(organizations):
     return organizations.exclude(is_host=True)
+
+@register.filter
+def unspam(email):
+    return email.replace('@', ' (at) ')
index 7c938fe1699e29c836cdfdb11852fd2553d4f593..84928c8e1db3b0199673b4dc9be53064791c46ac 100644 (file)
@@ -31,7 +31,7 @@
         {{ person.bio|richtext_filters|safe }}
     {% endeditable %}
 
-    <p><strong>{% trans 'Email' %} :</strong> {% if not person.email %}{{ person_email }}{% else %}{{ person.email }}{% endif %}</p>
+    <p><strong>{% trans 'Email' %} :</strong> {% if not person.email %}{{ person_email }}{% else %}{{ person.email|unspam }}{% endif %}</p>
 
     {% with person.activities.all as activities %}
       {% if activities %}