Skip to content

Commit

Permalink
adds an email link to the user account page
Browse files Browse the repository at this point in the history
  • Loading branch information
LGD-Fr committed Sep 17, 2015
1 parent 7de612b commit e78532b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions paiji2/settings_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,5 @@
EMAIL_HOST_USER = 'me'
EMAIL_HOST_PASSWORD = 'alibaba'
EMAIL_USE_TLS = True

REZO_MAIL = 'test-rezo@mydomain.td'
3 changes: 3 additions & 0 deletions rezo/templates/rezo/account.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ <h3>{{ _('due')|title }}</h3>
</tbody>
</table>
{% trans 'If these informations are false, or if you have unregistered equipment, please contact the Rezo.' %}
{% if mail_adress %}
<a href="mailto:{{ mail_adress|urlencode }}">{{ mail_adress }}</a>
{% endif %}
</div>
{% endcache %}
{% endblock %}
10 changes: 10 additions & 0 deletions rezo/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,3 +186,13 @@ def get_object(self, *args, **kwargs):

class RezoAccountView(generic.TemplateView):
template_name = 'rezo/account.html'

def get_context_data(self, *args, **kwargs):
cd = super(RezoAccountView, self).get_context_data(*args, **kwargs)
try:
cd['mail_adress'] = settings.REZO_MAIL
except Exception as e:
print 'REZO_MAIL setting fetching failed : <' +\
e.message + '>'
cd['mail_adress'] = None
return cd

0 comments on commit e78532b

Please sign in to comment.