add inbox view
This commit is contained in:
@@ -148,15 +148,19 @@ def unsubscribe(thread_id):
|
||||
|
||||
user = get_active_user()
|
||||
last_post_id = request.form.get('last_post_id', None)
|
||||
if last_post_id is None:
|
||||
|
||||
return_to = request.form.get('return_to', None)
|
||||
if return_to is None and last_post_id is None:
|
||||
abort(400)
|
||||
elif return_to is None and last_post_id is not None:
|
||||
return_to = url_for('.thread_by_id', thread_id=thread_id, after=last_post_id)
|
||||
|
||||
subscription = Subscriptions.find({'user_id': user.id, 'thread_id': thread_id})
|
||||
if not subscription:
|
||||
return redirect(url_for('.thread_by_id', thread_id=thread_id, after=last_post_id))
|
||||
return redirect(return_to)
|
||||
|
||||
subscription.delete()
|
||||
return redirect(url_for('.thread_by_id', thread_id=thread_id, after=last_post_id))
|
||||
return redirect(return_to)
|
||||
|
||||
@bp.get('/<int:thread_id>/feed.atom/')
|
||||
def feed(thread_id):
|
||||
|
||||
Reference in New Issue
Block a user