Skip to content
Snippets Groups Projects
Commit e6c88ee5 authored by Martin Mareš's avatar Martin Mareš
Browse files

DSN: Uživatel si může zobrazit své nedoručenky

parent 99bd1da6
Branches
No related tags found
1 merge request!138Zpracování nedoručenek
...@@ -674,6 +674,21 @@ def handle_forbidden(e): ...@@ -674,6 +674,21 @@ def handle_forbidden(e):
return render_template('forbidden.html'), 403 return render_template('forbidden.html'), 403
@app.route('/acct/dsn')
def user_dsn():
sess = db.get_session()
user = g.user
if not user:
raise NeedLoginError()
dsns = (sess.query(db.EmailDSN)
.filter_by(user=user)
.order_by(db.EmailDSN.arrived_at.desc())
.all())
return render_template('acct_dsn.html', user=user, dsns=dsns)
if getattr(config, 'INSECURE_TEST_LOGIN', False): if getattr(config, 'INSECURE_TEST_LOGIN', False):
@app.route('/test-login/<email>') @app.route('/test-login/<email>')
def test_login(email: str): def test_login(email: str):
......
{% extends "base.html" %}
{% block title %}Nedoručitelné e-maily{% endblock %}
{% block body %}
{% if dsns %}
<p>
Tuto e-mailovou adresu považujeme za nefunkční, protože pošta na ni poslaná
se vrátila jako nedoručitelná. Zde jsou zprávy o nedoručitelnosti e-mailů z nedávné doby.
</p>
{% include "parts/dsn.html" %}
{% else %}
<p><em>Momentálně neevidujeme žádnou nedoručitelnou poštu.</em></p>
{% endif %}
<div class="btn-group">
<a class='btn btn-primary' href='{{ url_for('user_validate_email') }}'>Ověřit e-mail</a>
<a class='btn btn-primary' href='{{ url_for('user_settings_personal') }}'>Změnit e-mail</a>
<a class='btn btn-default' href="{{ url_for('user_settings') }}">Zpět na nastavení účtu</a>
</div>
{% endblock %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment