fix slash in url: use alias_id instead of alias
This commit is contained in:
parent
47bf6646fc
commit
f860471d50
|
@ -133,8 +133,12 @@
|
|||
|
||||
<nav aria-label="Alias log navigation">
|
||||
<ul class="pagination">
|
||||
<li class="page-item {% if page_id == 0 %}disabled{% endif %}"><a class="page-link" href="{{ url_for('dashboard.alias_log', alias=alias, page_id=page_id-1) }}">Previous</a></li>
|
||||
<li class="page-item {% if last_page %}disabled{% endif %}"><a class="page-link" href="{{ url_for('dashboard.alias_log', alias=alias, page_id=page_id+1) }}">Next</a></li>
|
||||
<li class="page-item {% if page_id == 0 %}disabled{% endif %}">
|
||||
<a class="page-link" href="{{ url_for('dashboard.alias_log', alias_id=alias_id, page_id=page_id-1) }}">Previous</a>
|
||||
</li>
|
||||
<li class="page-item {% if last_page %}disabled{% endif %}">
|
||||
<a class="page-link" href="{{ url_for('dashboard.alias_log', alias_id=alias_id, page_id=page_id+1) }}">Next</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
{% endblock %}
|
||||
|
|
|
@ -111,7 +111,7 @@
|
|||
<span class="alias-activity">{{ alias_info.nb_forward }}</span> forwards,
|
||||
<span class="alias-activity">{{ alias_info.nb_blocked }}</span> blocks,
|
||||
<span class="alias-activity">{{ alias_info.nb_reply }}</span> replies
|
||||
<a href="{{ url_for('dashboard.alias_log', alias=gen_email.email) }}"
|
||||
<a href="{{ url_for('dashboard.alias_log', alias_id=gen_email.id) }}"
|
||||
class="btn btn-sm btn-link">
|
||||
See All Activity →
|
||||
</a>
|
||||
|
|
|
@ -22,11 +22,13 @@ class AliasLog:
|
|||
setattr(self, k, v)
|
||||
|
||||
|
||||
@dashboard_bp.route("/alias_log/<alias>", methods=["GET"], defaults={"page_id": 0})
|
||||
@dashboard_bp.route("/alias_log/<alias>/<int:page_id>")
|
||||
@dashboard_bp.route(
|
||||
"/alias_log/<int:alias_id>", methods=["GET"], defaults={"page_id": 0}
|
||||
)
|
||||
@dashboard_bp.route("/alias_log/<int:alias_id>/<int:page_id>")
|
||||
@login_required
|
||||
def alias_log(alias, page_id):
|
||||
gen_email = GenEmail.get_by(email=alias)
|
||||
def alias_log(alias_id, page_id):
|
||||
gen_email = GenEmail.get(alias_id)
|
||||
|
||||
# sanity check
|
||||
if not gen_email:
|
||||
|
|
Loading…
Reference in a new issue