Skip to content
Snippets Groups Projects
Commit dfecd5d9 authored by Robin Sonnabend's avatar Robin Sonnabend
Browse files

Previous tut (erstmal) wieder

parent 6928922e
No related branches found
No related tags found
No related merge requests found
...@@ -325,8 +325,8 @@ def statement_delete(): ...@@ -325,8 +325,8 @@ def statement_delete():
@admin_permission.require() @admin_permission.require()
def statement_undo(): def statement_undo():
topic_id = request.args.get("topic_id", None) topic_id = request.args.get("topic_id", None)
if statement_id is not None: if topic_id is not None:
statement = Statement.query.filter_by(executed=True).order_by(db.desc(Statement.execution_time)).first() statement = Statement.query.filter_by(executed=True, topic_id=topic_id).order_by(db.desc(Statement.execution_time)).first()
statement.undo() statement.undo()
db.session.commit() db.session.commit()
return redirect(url_for(".topic_show", id=topic_id)) return redirect(url_for(".topic_show", id=topic_id))
......
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
<a href="{{ url_for(".statement_done", id=topic.sorted_statements()[0].id, topic_id=topic.id) }}" class="rede-href"><i class="material-icons" role="presentation">redo</i> Next</a> <a href="{{ url_for(".statement_done", id=topic.sorted_statements()[0].id, topic_id=topic.id) }}" class="rede-href"><i class="material-icons" role="presentation">redo</i> Next</a>
</li> </li>
{% endif %} {% endif %}
<li><a href="{{ url_for(".statement_undo") }}" class="rede-href"><i class="material-icons" role="presentation">undo</i> Previous</a></li> <li><a href="{{ url_for(".statement_undo", topic_id=topic.id) }}" class="rede-href"><i class="material-icons" role="presentation">undo</i> Previous</a></li>
<li><a href="{{ url_for(".topic_show", id=topic.get_next_index()) }}"><i class="material-icons">arrow_forward</i> Next Topic</a></li> <li><a href="{{ url_for(".topic_show", id=topic.get_next_index()) }}"><i class="material-icons">arrow_forward</i> Next Topic</a></li>
<li><a href="{{ url_for(".topic_show", id=topic.get_previous_index()) }}"><i class="material-icons">arrow_backward</i>Previous Topic</a></li> <li><a href="{{ url_for(".topic_show", id=topic.get_previous_index()) }}"><i class="material-icons">arrow_backward</i>Previous Topic</a></li>
<li> <li>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment