Implement flask-breadcrumbs everywhere

This commit is contained in:
Patrick Jentsch
2023-03-14 11:13:35 +01:00
parent bac526b927
commit c91004d6ba
38 changed files with 509 additions and 443 deletions

View File

@ -1,5 +1,2 @@
from flask import Blueprint
bp = Blueprint('followers', __name__)
from .. import bp
from . import json_routes

View File

@ -12,15 +12,7 @@ from ..decorators import corpus_owner_or_admin_required
from . import bp
##############################################################################
# IMPORTANT NOTE: These routes are prefixed by the blueprint #
# Prefix: <hashid:corpus_id>/followers #
# This implies that the corpus_id is always in the kwargs of #
# a route that is registered to this blueprint. #
##############################################################################
@bp.route('', methods=['POST'])
@bp.route('/<hashid:corpus_id>/followers', methods=['POST'])
@login_required
@corpus_owner_or_admin_required
@content_negotiation(consumes='application/json', produces='application/json')
@ -42,7 +34,7 @@ def create_corpus_followers(corpus_id):
return response
@bp.route('/<hashid:follower_id>/role', methods=['PUT'])
@bp.route('/<hashid:corpus_id>/followers/<hashid:follower_id>/role', methods=['PUT'])
@login_required
@corpus_owner_or_admin_required
@content_negotiation(consumes='application/json', produces='application/json')
@ -65,7 +57,7 @@ def update_corpus_follower_role(corpus_id, follower_id):
return response
@bp.route('/<hashid:follower_id>', methods=['DELETE'])
@bp.route('/<hashid:corpus_id>/followers/<hashid:follower_id>', methods=['DELETE'])
@login_required
@content_negotiation(produces='application/json')
def delete_corpus_follower(corpus_id, follower_id):