rewrite threads routes to include id
This commit is contained in:
@@ -62,7 +62,7 @@ def move_thread(thread_id):
|
||||
if not target_topic:
|
||||
abort(404)
|
||||
thread.update({'topic_id': target_topic.id})
|
||||
return redirect(url_for('threads.thread', slug=thread.slug))
|
||||
return redirect(url_for('threads.thread_by_id', thread_id=thread.id))
|
||||
|
||||
@bp.post('/threads/<int:thread_id>/lock/')
|
||||
def lock_thread(thread_id):
|
||||
@@ -70,7 +70,7 @@ def lock_thread(thread_id):
|
||||
if not thread:
|
||||
abort(404)
|
||||
thread.update({'is_locked': request.form.get('lock')})
|
||||
return redirect(url_for('threads.thread', slug=thread.slug))
|
||||
return redirect(url_for('threads.thread_by_id', thread_id=thread.id))
|
||||
|
||||
@bp.post('/threads/<int:thread_id>/sticky/')
|
||||
def sticky_thread(thread_id):
|
||||
@@ -78,7 +78,7 @@ def sticky_thread(thread_id):
|
||||
if not thread:
|
||||
abort(404)
|
||||
thread.update({'is_stickied': request.form.get('sticky')})
|
||||
return redirect(url_for('threads.thread', slug=thread.slug))
|
||||
return redirect(url_for('threads.thread_by_id', thread_id=thread.id))
|
||||
|
||||
@bp.post('/users/<int:user_id>/make-guest/')
|
||||
@csrf_verified
|
||||
|
||||
Reference in New Issue
Block a user