~homeworkprod/byceps

533662eefb314d54b168e5a46bc07c88b5f88be4 — Jochen Kupperschmidt a month ago 342e529
Use Flask v2.0's `delete`/`get`/`patch`/`post` route shortcuts
73 files changed, 348 insertions(+), 378 deletions(-)

M byceps/blueprints/admin/attendance/views.py
M byceps/blueprints/admin/authentication/login/views.py
M byceps/blueprints/admin/authorization/views.py
M byceps/blueprints/admin/board/views.py
M byceps/blueprints/admin/brand/views.py
M byceps/blueprints/admin/consent/views.py
M byceps/blueprints/admin/dashboard/views.py
M byceps/blueprints/admin/jobs/views.py
M byceps/blueprints/admin/maintenance/views.py
M byceps/blueprints/admin/more/views.py
M byceps/blueprints/admin/news/views.py
M byceps/blueprints/admin/newsletter/views.py
M byceps/blueprints/admin/orga/views.py
M byceps/blueprints/admin/orga_presence/views.py
M byceps/blueprints/admin/orga_team/views.py
M byceps/blueprints/admin/party/views.py
M byceps/blueprints/admin/seating/views.py
M byceps/blueprints/admin/shop/article/views.py
M byceps/blueprints/admin/shop/email/views.py
M byceps/blueprints/admin/shop/order/views.py
M byceps/blueprints/admin/shop/shipping/views.py
M byceps/blueprints/admin/shop/shop/views.py
M byceps/blueprints/admin/shop/storefront/views.py
M byceps/blueprints/admin/site/views.py
M byceps/blueprints/admin/snippet/views.py
M byceps/blueprints/admin/terms/views.py
M byceps/blueprints/admin/ticketing/category/views.py
M byceps/blueprints/admin/ticketing/checkin/views.py
M byceps/blueprints/admin/ticketing/views.py
M byceps/blueprints/admin/tourney/category/views.py
M byceps/blueprints/admin/tourney/tourney/views.py
M byceps/blueprints/admin/user/views.py
M byceps/blueprints/admin/user_badge/views.py
M byceps/blueprints/admin/webhook/views.py
M byceps/blueprints/api/v1/attendance/views.py
M byceps/blueprints/api/v1/snippet/views.py
M byceps/blueprints/api/v1/tourney/avatar/views.py
M byceps/blueprints/api/v1/tourney/match/comments/views.py
M byceps/blueprints/api/v1/user/views.py
M byceps/blueprints/api/v1/user_avatar/views.py
M byceps/blueprints/api/v1/user_badge/views.py
M byceps/blueprints/common/authentication/password/views.py
M byceps/blueprints/common/locale/views.py
M byceps/blueprints/common/style_guide/views.py
M byceps/blueprints/monitoring/healthcheck/views.py
M byceps/blueprints/monitoring/metrics/views.py
M byceps/blueprints/site/attendance/views.py
M byceps/blueprints/site/authentication/login/views.py
M byceps/blueprints/site/board/views_category.py
M byceps/blueprints/site/board/views_posting.py
M byceps/blueprints/site/board/views_topic.py
M byceps/blueprints/site/consent/views.py
M byceps/blueprints/site/dashboard/views.py
M byceps/blueprints/site/news/views.py
M byceps/blueprints/site/newsletter/views.py
M byceps/blueprints/site/orga_team/views.py
M byceps/blueprints/site/party/views.py
M byceps/blueprints/site/seating/views.py
M byceps/blueprints/site/shop/order/views.py
M byceps/blueprints/site/shop/orders/views.py
M byceps/blueprints/site/snippet/views.py
M byceps/blueprints/site/terms/views.py
M byceps/blueprints/site/ticketing/views.py
M byceps/blueprints/site/tourney/views.py
M byceps/blueprints/site/user/avatar/views.py
M byceps/blueprints/site/user/creation/views.py
M byceps/blueprints/site/user/current/views.py
M byceps/blueprints/site/user/email_address/views.py
M byceps/blueprints/site/user/settings/views.py
M byceps/blueprints/site/user_badge/views.py
M byceps/blueprints/site/user_group/views.py
M byceps/blueprints/site/user_message/views.py
M byceps/blueprints/site/user_profile/views.py
M byceps/blueprints/admin/attendance/views.py => byceps/blueprints/admin/attendance/views.py +1 -1
@@ 22,7 22,7 @@ from ..core.authorization import AdminPermission
blueprint = create_blueprint('attendance_admin', __name__)


@blueprint.route('/brands/<brand_id>')
@blueprint.get('/brands/<brand_id>')
@permission_required(AdminPermission.access)
@templated
def view_for_brand(brand_id):

M byceps/blueprints/admin/authentication/login/views.py => byceps/blueprints/admin/authentication/login/views.py +3 -3
@@ 29,7 29,7 @@ from .forms import LoginForm
blueprint = create_blueprint('authentication.login_admin', __name__)


@blueprint.route('/login')
@blueprint.get('/login')
@templated
def login_form():
    """Show login form."""


@@ 47,7 47,7 @@ def login_form():
    return {'form': form}


@blueprint.route('/login', methods=['POST'])
@blueprint.post('/login')
@respond_no_content
def login():
    """Allow the user to authenticate with e-mail address and password."""


@@ 94,7 94,7 @@ def _require_admin_access_permission(user_id: UserID) -> None:
        abort(403)


@blueprint.route('/logout', methods=['POST'])
@blueprint.post('/logout')
@respond_no_content
def logout():
    """Log out user by deleting the corresponding cookie."""

M byceps/blueprints/admin/authorization/views.py => byceps/blueprints/admin/authorization/views.py +3 -3
@@ 24,7 24,7 @@ blueprint = create_blueprint('authorization_admin', __name__)
register_permission_enum(RolePermission)


@blueprint.route('/permissions')
@blueprint.get('/permissions')
@permission_required(RolePermission.view)
@templated
def permission_index():


@@ 34,7 34,7 @@ def permission_index():
    return {'permissions': permissions}


@blueprint.route('/roles')
@blueprint.get('/roles')
@permission_required(RolePermission.view)
@templated
def role_index():


@@ 44,7 44,7 @@ def role_index():
    return {'roles': roles}


@blueprint.route('/roles/<role_id>')
@blueprint.get('/roles/<role_id>')
@permission_required(RolePermission.view)
@templated
def role_view(role_id):

M byceps/blueprints/admin/board/views.py => byceps/blueprints/admin/board/views.py +13 -17
@@ 50,7 50,7 @@ class BoardStats:
# boards


@blueprint.route('/brands/<brand_id>')
@blueprint.get('/brands/<brand_id>')
@permission_required(BoardCategoryPermission.view)
@templated
def board_index_for_brand(brand_id):


@@ 76,7 76,7 @@ def board_index_for_brand(brand_id):
    }


@blueprint.route('/boards/<board_id>')
@blueprint.get('/boards/<board_id>')
@permission_required(BoardCategoryPermission.view)
@templated
def board_view(board_id):


@@ 95,7 95,7 @@ def board_view(board_id):
    }


@blueprint.route('/for_brand/<brand_id>/boards/create')
@blueprint.get('/for_brand/<brand_id>/boards/create')
@permission_required(BoardPermission.create)
@templated
def board_create_form(brand_id, erroneous_form=None):


@@ 110,7 110,7 @@ def board_create_form(brand_id, erroneous_form=None):
    }


@blueprint.route('/for_brand/<brand_id>/boards', methods=['POST'])
@blueprint.post('/for_brand/<brand_id>/boards')
@permission_required(BoardPermission.create)
def board_create(brand_id):
    """Create a board."""


@@ 137,7 137,7 @@ def board_create(brand_id):
# categories


@blueprint.route('/categories/for_board/<board_id>/create')
@blueprint.get('/categories/for_board/<board_id>/create')
@permission_required(BoardCategoryPermission.create)
@templated
def category_create_form(board_id, erroneous_form=None):


@@ 155,7 155,7 @@ def category_create_form(board_id, erroneous_form=None):
    }


@blueprint.route('/categories/for_board/<board_id>', methods=['POST'])
@blueprint.post('/categories/for_board/<board_id>')
@permission_required(BoardCategoryPermission.create)
def category_create(board_id):
    """Create a category."""


@@ 182,7 182,7 @@ def category_create(board_id):
    return redirect_to('.board_view', board_id=board.id)


@blueprint.route('/categories/<uuid:category_id>/update')
@blueprint.get('/categories/<uuid:category_id>/update')
@permission_required(BoardCategoryPermission.update)
@templated
def category_update_form(category_id, erroneous_form=None):


@@ 203,7 203,7 @@ def category_update_form(category_id, erroneous_form=None):
    }


@blueprint.route('/categories/<uuid:category_id>', methods=['POST'])
@blueprint.post('/categories/<uuid:category_id>')
@permission_required(BoardCategoryPermission.update)
def category_update(category_id):
    """Update the category."""


@@ 230,9 230,7 @@ def category_update(category_id):
    return redirect_to('.board_view', board_id=category.board_id)


@blueprint.route(
    '/categories/<uuid:category_id>/flags/hidden', methods=['POST']
)
@blueprint.post('/categories/<uuid:category_id>/flags/hidden')
@permission_required(BoardCategoryPermission.update)
@respond_no_content
def category_hide(category_id):


@@ 249,9 247,7 @@ def category_hide(category_id):
    )


@blueprint.route(
    '/categories/<uuid:category_id>/flags/hidden', methods=['DELETE']
)
@blueprint.delete('/categories/<uuid:category_id>/flags/hidden')
@permission_required(BoardCategoryPermission.update)
@respond_no_content
def category_unhide(category_id):


@@ 268,7 264,7 @@ def category_unhide(category_id):
    )


@blueprint.route('/categories/<uuid:category_id>/up', methods=['POST'])
@blueprint.post('/categories/<uuid:category_id>/up')
@permission_required(BoardCategoryPermission.update)
@respond_no_content
def category_move_up(category_id):


@@ 293,7 289,7 @@ def category_move_up(category_id):
        )


@blueprint.route('/categories/<uuid:category_id>/down', methods=['POST'])
@blueprint.post('/categories/<uuid:category_id>/down')
@permission_required(BoardCategoryPermission.update)
@respond_no_content
def category_move_down(category_id):


@@ 318,7 314,7 @@ def category_move_down(category_id):
        )


@blueprint.route('/categories/<uuid:category_id>', methods=['DELETE'])
@blueprint.delete('/categories/<uuid:category_id>')
@permission_required(BoardCategoryPermission.create)
@respond_no_content
def category_delete(category_id):

M byceps/blueprints/admin/brand/views.py => byceps/blueprints/admin/brand/views.py +8 -8
@@ 32,7 32,7 @@ blueprint = create_blueprint('brand_admin', __name__)
register_permission_enum(BrandPermission)


@blueprint.route('/')
@blueprint.get('/')
@permission_required(BrandPermission.view)
@templated
def index():


@@ 50,7 50,7 @@ def index():
    }


@blueprint.route('/brands/<brand_id>')
@blueprint.get('/brands/<brand_id>')
@permission_required(BrandPermission.view)
@templated
def view(brand_id):


@@ 67,7 67,7 @@ def view(brand_id):
    }


@blueprint.route('/create')
@blueprint.get('/create')
@permission_required(BrandPermission.create)
@templated
def create_form(erroneous_form=None):


@@ 79,7 79,7 @@ def create_form(erroneous_form=None):
    }


@blueprint.route('/', methods=['POST'])
@blueprint.post('/')
@permission_required(BrandPermission.create)
def create():
    """Create a brand."""


@@ 106,7 106,7 @@ def create():
    return redirect_to('.index')


@blueprint.route('/brands/<brand_id>/update')
@blueprint.get('/brands/<brand_id>/update')
@permission_required(BrandPermission.update)
@templated
def update_form(brand_id, erroneous_form=None):


@@ 121,7 121,7 @@ def update_form(brand_id, erroneous_form=None):
    }


@blueprint.route('/brands/<brand_id>', methods=['POST'])
@blueprint.post('/brands/<brand_id>')
@permission_required(BrandPermission.update)
def update(brand_id):
    """Update a brand."""


@@ 149,7 149,7 @@ def update(brand_id):
# email config


@blueprint.route('/brands/<brand_id>/email_config/update')
@blueprint.get('/brands/<brand_id>/email_config/update')
@permission_required(BrandPermission.update)
@templated
def email_config_update_form(brand_id, erroneous_form=None):


@@ 175,7 175,7 @@ def email_config_update_form(brand_id, erroneous_form=None):
    }


@blueprint.route('/brands/<brand_id>/email_config', methods=['POST'])
@blueprint.post('/brands/<brand_id>/email_config')
@permission_required(BrandPermission.update)
def email_config_update(brand_id):
    """Update e-mail config."""

M byceps/blueprints/admin/consent/views.py => byceps/blueprints/admin/consent/views.py +1 -1
@@ 21,7 21,7 @@ blueprint = create_blueprint('consent_admin', __name__)
register_permission_enum(ConsentPermission)


@blueprint.route('/')
@blueprint.get('/')
@permission_required(ConsentPermission.administrate)
@templated
def index():

M byceps/blueprints/admin/dashboard/views.py => byceps/blueprints/admin/dashboard/views.py +3 -3
@@ 45,7 45,7 @@ blueprint = create_blueprint('admin_dashboard', __name__)
register_permission_enum(AdminDashboardPermission)


@blueprint.route('')
@blueprint.get('')
@permission_required(AdminDashboardPermission.view_global)
@templated
def view_global():


@@ 99,7 99,7 @@ def view_global():
    }


@blueprint.route('/brands/<brand_id>')
@blueprint.get('/brands/<brand_id>')
@permission_required(AdminDashboardPermission.view_brand)
@templated
def view_brand(brand_id):


@@ 165,7 165,7 @@ def view_brand(brand_id):
    }


@blueprint.route('/parties/<party_id>')
@blueprint.get('/parties/<party_id>')
@permission_required(AdminDashboardPermission.view_party)
@templated
def view_party(party_id):

M byceps/blueprints/admin/jobs/views.py => byceps/blueprints/admin/jobs/views.py +1 -1
@@ 20,7 20,7 @@ blueprint = create_blueprint('jobs_admin', __name__)
register_permission_enum(JobsPermission)


@blueprint.route('/')
@blueprint.get('/')
@permission_required(JobsPermission.view)
@templated
def index():

M byceps/blueprints/admin/maintenance/views.py => byceps/blueprints/admin/maintenance/views.py +2 -2
@@ 22,7 22,7 @@ from ..core.authorization import AdminPermission
blueprint = create_blueprint('maintenance_admin', __name__)


@blueprint.route('')
@blueprint.get('')
@permission_required(AdminPermission.access)
@templated
def index():


@@ 30,7 30,7 @@ def index():
    return {}


@blueprint.route('/delete_old_login_events', methods=['POST'])
@blueprint.post('/delete_old_login_events')
@permission_required(AdminPermission.access)
@respond_no_content
def delete_old_login_events():

M byceps/blueprints/admin/more/views.py => byceps/blueprints/admin/more/views.py +4 -4
@@ 21,7 21,7 @@ from ..core.authorization import AdminPermission
blueprint = create_blueprint('more_admin', __name__)


@blueprint.route('/global')
@blueprint.get('/global')
@permission_required(AdminPermission.access)
@templated
def view_global():


@@ 29,7 29,7 @@ def view_global():
    return {}


@blueprint.route('/brands/<brand_id>')
@blueprint.get('/brands/<brand_id>')
@permission_required(AdminPermission.access)
@templated
def view_brand(brand_id):


@@ 41,7 41,7 @@ def view_brand(brand_id):
    return {'brand': brand}


@blueprint.route('/parties/<party_id>')
@blueprint.get('/parties/<party_id>')
@permission_required(AdminPermission.access)
@templated
def view_party(party_id):


@@ 53,7 53,7 @@ def view_party(party_id):
    return {'party': party}


@blueprint.route('/sites/<site_id>')
@blueprint.get('/sites/<site_id>')
@permission_required(AdminPermission.access)
@templated
def view_site(site_id):

M byceps/blueprints/admin/news/views.py => byceps/blueprints/admin/news/views.py +20 -22
@@ 52,7 52,7 @@ register_permission_enum(NewsItemPermission)
# channels


@blueprint.route('/brands/<brand_id>')
@blueprint.get('/brands/<brand_id>')
@permission_required(NewsItemPermission.view)
@templated
def channel_index_for_brand(brand_id):


@@ 70,7 70,7 @@ def channel_index_for_brand(brand_id):
    }


@blueprint.route('/for_brand/<brand_id>/channels/create')
@blueprint.get('/for_brand/<brand_id>/channels/create')
@permission_required(NewsChannelPermission.create)
@templated
def channel_create_form(brand_id, erroneous_form=None):


@@ 85,7 85,7 @@ def channel_create_form(brand_id, erroneous_form=None):
    }


@blueprint.route('/for_brand/<brand_id>/channels', methods=['POST'])
@blueprint.post('/for_brand/<brand_id>/channels')
@permission_required(NewsChannelPermission.create)
def channel_create(brand_id):
    """Create a channel."""


@@ 111,8 111,8 @@ def channel_create(brand_id):
    return redirect_to('.channel_view', channel_id=channel.id)


@blueprint.route('/channels/<channel_id>', defaults={'page': 1})
@blueprint.route('/channels/<channel_id>/pages/<int:page>')
@blueprint.get('/channels/<channel_id>', defaults={'page': 1})
@blueprint.get('/channels/<channel_id>/pages/<int:page>')
@permission_required(NewsItemPermission.view)
@templated
def channel_view(channel_id, page):


@@ 136,7 136,7 @@ def channel_view(channel_id, page):
# images


@blueprint.route('/for_item/<item_id>/create')
@blueprint.get('/for_item/<item_id>/create')
@permission_required(NewsItemPermission.update)
@templated
def image_create_form(item_id, erroneous_form=None):


@@ 157,7 157,7 @@ def image_create_form(item_id, erroneous_form=None):
    }


@blueprint.route('/for_item/<item_id>', methods=['POST'])
@blueprint.post('/for_item/<item_id>')
@permission_required(NewsItemPermission.update)
def image_create(item_id):
    """Create a news image."""


@@ 207,7 207,7 @@ def image_create(item_id):
    return redirect_to('.item_view', item_id=image.item_id)


@blueprint.route('/images/<uuid:image_id>/update')
@blueprint.get('/images/<uuid:image_id>/update')
@permission_required(NewsItemPermission.update)
@templated
def image_update_form(image_id, erroneous_form=None):


@@ 224,7 224,7 @@ def image_update_form(image_id, erroneous_form=None):
    }


@blueprint.route('/images/<uuid:image_id>', methods=['POST'])
@blueprint.post('/images/<uuid:image_id>')
@permission_required(NewsItemPermission.update)
def image_update(image_id):
    """Update a news image."""


@@ 259,7 259,7 @@ def image_update(image_id):
# items


@blueprint.route('/items/<uuid:item_id>')
@blueprint.get('/items/<uuid:item_id>')
@permission_required(NewsItemPermission.view)
@templated('admin/news/item_view_version')
def item_view(item_id):


@@ 271,7 271,7 @@ def item_view(item_id):
    return _render_item_version(version, item)


@blueprint.route('/versions/<uuid:version_id>')
@blueprint.get('/versions/<uuid:version_id>')
@permission_required(NewsItemPermission.view)
@templated
def item_view_version(version_id):


@@ 319,7 319,7 @@ def _render_item_version(version, item):
    return context


@blueprint.route('/items/<uuid:item_id>/versions')
@blueprint.get('/items/<uuid:item_id>/versions')
@permission_required(NewsItemPermission.view)
@templated
def item_list_versions(item_id):


@@ 339,9 339,7 @@ def item_list_versions(item_id):
    }


@blueprint.route(
    '/items/<uuid:from_version_id>/compare_to/<uuid:to_version_id>'
)
@blueprint.get('/items/<uuid:from_version_id>/compare_to/<uuid:to_version_id>')
@permission_required(NewsItemPermission.view)
@templated
def item_compare_versions(from_version_id, to_version_id):


@@ 370,7 368,7 @@ def item_compare_versions(from_version_id, to_version_id):
    }


@blueprint.route('/for_channel/<channel_id>/create')
@blueprint.get('/for_channel/<channel_id>/create')
@permission_required(NewsItemPermission.create)
@templated
def item_create_form(channel_id, erroneous_form=None):


@@ 389,7 387,7 @@ def item_create_form(channel_id, erroneous_form=None):
    }


@blueprint.route('/for_channel/<channel_id>', methods=['POST'])
@blueprint.post('/for_channel/<channel_id>')
@permission_required(NewsItemPermission.create)
def item_create(channel_id):
    """Create a news item."""


@@ 416,7 414,7 @@ def item_create(channel_id):
    return redirect_to('.item_view', item_id=item.id)


@blueprint.route('/items/<uuid:item_id>/update')
@blueprint.get('/items/<uuid:item_id>/update')
@permission_required(NewsItemPermission.update)
@templated
def item_update_form(item_id, erroneous_form=None):


@@ 437,7 435,7 @@ def item_update_form(item_id, erroneous_form=None):
    }


@blueprint.route('/items/<uuid:item_id>', methods=['POST'])
@blueprint.post('/items/<uuid:item_id>')
@permission_required(NewsItemPermission.update)
def item_update(item_id):
    """Update a news item."""


@@ 464,7 462,7 @@ def item_update(item_id):
    return redirect_to('.item_view', item_id=item.id)


@blueprint.route('/items/<uuid:item_id>/publish_later')
@blueprint.get('/items/<uuid:item_id>/publish_later')
@permission_required(NewsItemPermission.publish)
@templated
def item_publish_later_form(item_id, erroneous_form=None):


@@ 479,7 477,7 @@ def item_publish_later_form(item_id, erroneous_form=None):
    }


@blueprint.route('/items/<uuid:item_id>/publish_later', methods=['POST'])
@blueprint.post('/items/<uuid:item_id>/publish_later')
@permission_required(NewsItemPermission.publish)
def item_publish_later(item_id):
    """Publish a news item at a time in the future."""


@@ 508,7 506,7 @@ def item_publish_later(item_id):
    return redirect_to('.item_view', item_id=item.id)


@blueprint.route('/items/<uuid:item_id>/publish_now', methods=['POST'])
@blueprint.post('/items/<uuid:item_id>/publish_now')
@permission_required(NewsItemPermission.publish)
@respond_no_content
def item_publish_now(item_id):

M byceps/blueprints/admin/newsletter/views.py => byceps/blueprints/admin/newsletter/views.py +4 -4
@@ 33,7 33,7 @@ class ListWithStats(List):
    subscriber_count: int


@blueprint.route('/lists')
@blueprint.get('/lists')
@permission_required(NewsletterPermission.view_subscriptions)
@templated
def index():


@@ 53,7 53,7 @@ def _add_subscriber_count(list_):
    return ListWithStats(list_.id, list_.title, subscriber_count)


@blueprint.route('/lists/<list_id>/subscriptions')
@blueprint.get('/lists/<list_id>/subscriptions')
@permission_required(NewsletterPermission.view_subscriptions)
@templated
def view_subscriptions(list_id):


@@ 69,7 69,7 @@ def view_subscriptions(list_id):
    }


@blueprint.route('/lists/<list_id>/subscriptions/export')
@blueprint.get('/lists/<list_id>/subscriptions/export')
@permission_required(NewsletterPermission.export_subscribers)
@jsonified
def export_subscribers(list_id):


@@ 92,7 92,7 @@ def assemble_subscriber_export(subscriber):
    }


@blueprint.route('/lists/<list_id>/subscriptions/email_addresses/export')
@blueprint.get('/lists/<list_id>/subscriptions/email_addresses/export')
@permission_required(NewsletterPermission.export_subscribers)
@textified
def export_subscriber_email_addresses(list_id):

M byceps/blueprints/admin/orga/views.py => byceps/blueprints/admin/orga/views.py +6 -6
@@ 42,7 42,7 @@ register_permission_enum(OrgaDetailPermission)
register_permission_enum(OrgaTeamPermission)


@blueprint.route('/persons/<brand_id>')
@blueprint.get('/persons/<brand_id>')
@permission_required(OrgaDetailPermission.view)
@templated
def persons_for_brand(brand_id):


@@ 69,7 69,7 @@ def _to_birthday(user) -> Optional[Birthday]:
    return Birthday(dob)


@blueprint.route('/persons/<brand_id>/create')
@blueprint.get('/persons/<brand_id>/create')
@permission_required(OrgaTeamPermission.administrate_memberships)
@templated
def create_orgaflag_form(brand_id, erroneous_form=None):


@@ 84,7 84,7 @@ def create_orgaflag_form(brand_id, erroneous_form=None):
    }


@blueprint.route('/persons/<brand_id>', methods=['POST'])
@blueprint.post('/persons/<brand_id>')
@permission_required(OrgaTeamPermission.administrate_memberships)
def create_orgaflag(brand_id):
    """Give the organizer flag to a user."""


@@ 110,7 110,7 @@ def create_orgaflag(brand_id):
    return redirect_to('.persons_for_brand', brand_id=orga_flag.brand.id)


@blueprint.route('/persons/<brand_id>/<uuid:user_id>', methods=['DELETE'])
@blueprint.delete('/persons/<brand_id>/<uuid:user_id>')
@permission_required(OrgaTeamPermission.administrate_memberships)
@respond_no_content
def remove_orgaflag(brand_id, user_id):


@@ 136,7 136,7 @@ def remove_orgaflag(brand_id, user_id):
    )


@blueprint.route('/persons/<brand_id>/export')
@blueprint.get('/persons/<brand_id>/export')
@permission_required(OrgaDetailPermission.view)
@textified
def export_persons(brand_id):


@@ 196,7 196,7 @@ def export_persons(brand_id):
    return serialize_to_csv(field_names, rows)


@blueprint.route('/birthdays')
@blueprint.get('/birthdays')
@permission_required(OrgaBirthdayPermission.view)
@templated
def birthdays():

M byceps/blueprints/admin/orga_presence/views.py => byceps/blueprints/admin/orga_presence/views.py +1 -1
@@ 35,7 35,7 @@ blueprint = create_blueprint('orga_presence', __name__)
register_permission_enum(OrgaPresencePermission)


@blueprint.route('/<party_id>')
@blueprint.get('/<party_id>')
@permission_required(OrgaPresencePermission.view)
@templated
def view(party_id):

M byceps/blueprints/admin/orga_team/views.py => byceps/blueprints/admin/orga_team/views.py +11 -11
@@ 37,7 37,7 @@ register_permission_enum(OrgaTeamPermission)
# teams


@blueprint.route('/teams/<party_id>')
@blueprint.get('/teams/<party_id>')
@permission_required(OrgaTeamPermission.view)
@templated
def teams_for_party(party_id):


@@ 65,7 65,7 @@ def teams_for_party(party_id):
    }


@blueprint.route('/teams/<party_id>/create')
@blueprint.get('/teams/<party_id>/create')
@permission_required(OrgaTeamPermission.create)
@templated
def team_create_form(party_id, erroneous_form=None):


@@ 80,7 80,7 @@ def team_create_form(party_id, erroneous_form=None):
    }


@blueprint.route('/teams/<party_id>', methods=['POST'])
@blueprint.post('/teams/<party_id>')
@permission_required(OrgaTeamPermission.create)
def team_create(party_id):
    """Create an organizer team for a party."""


@@ 104,7 104,7 @@ def team_create(party_id):
    return redirect_to('.teams_for_party', party_id=party.id)


@blueprint.route('/teams/<uuid:team_id>', methods=['DELETE'])
@blueprint.delete('/teams/<uuid:team_id>')
@permission_required(OrgaTeamPermission.delete)
@respond_no_content
def team_delete(team_id):


@@ 127,7 127,7 @@ def team_delete(team_id):
    flash_success(gettext('Team "%(title)s" has been deleted.', title=title))


@blueprint.route('/teams/<target_party_id>/copy')
@blueprint.get('/teams/<target_party_id>/copy')
@permission_required(OrgaTeamPermission.create)
@templated
def teams_copy_form(target_party_id, erroneous_form=None):


@@ 171,7 171,7 @@ def teams_copy_form(target_party_id, erroneous_form=None):
    }


@blueprint.route('/teams/<target_party_id>/copy', methods=['POST'])
@blueprint.post('/teams/<target_party_id>/copy')
@permission_required(OrgaTeamPermission.create)
def teams_copy(target_party_id):
    """Copy all organizer teams from another party."""


@@ 216,7 216,7 @@ def teams_copy(target_party_id):
# memberships


@blueprint.route('/teams/<uuid:team_id>/memberships/create')
@blueprint.get('/teams/<uuid:team_id>/memberships/create')
@permission_required(OrgaTeamPermission.administrate_memberships)
@templated
def membership_create_form(team_id, erroneous_form=None):


@@ 251,7 251,7 @@ def membership_create_form(team_id, erroneous_form=None):
    }


@blueprint.route('/teams/<uuid:team_id>/memberships', methods=['POST'])
@blueprint.post('/teams/<uuid:team_id>/memberships')
@permission_required(OrgaTeamPermission.administrate_memberships)
def membership_create(team_id):
    """Assign an organizer to that team."""


@@ 282,7 282,7 @@ def membership_create(team_id):
    return redirect_to('.teams_for_party', party_id=team.party_id)


@blueprint.route('/memberships/<uuid:membership_id>/update')
@blueprint.get('/memberships/<uuid:membership_id>/update')
@permission_required(OrgaTeamPermission.administrate_memberships)
@templated
def membership_update_form(membership_id, erroneous_form=None):


@@ 311,7 311,7 @@ def membership_update_form(membership_id, erroneous_form=None):
    }


@blueprint.route('/memberships/<uuid:membership_id>', methods=['POST'])
@blueprint.post('/memberships/<uuid:membership_id>')
@permission_required(OrgaTeamPermission.administrate_memberships)
def membership_update(membership_id):
    """Update a membership."""


@@ 343,7 343,7 @@ def membership_update(membership_id):
    return redirect_to('.teams_for_party', party_id=team.party_id)


@blueprint.route('/memberships/<uuid:membership_id>', methods=['DELETE'])
@blueprint.delete('/memberships/<uuid:membership_id>')
@permission_required(OrgaTeamPermission.administrate_memberships)
@respond_no_content
def membership_remove(membership_id):

M byceps/blueprints/admin/party/views.py => byceps/blueprints/admin/party/views.py +8 -8
@@ 39,7 39,7 @@ blueprint = create_blueprint('party_admin', __name__)
register_permission_enum(PartyPermission)


@blueprint.route('/')
@blueprint.get('/')
@permission_required(PartyPermission.view)
@templated
def index():


@@ 67,8 67,8 @@ def index():
    }


@blueprint.route('/brands/<brand_id>', defaults={'page': 1})
@blueprint.route('/brands/<brand_id>/pages/<int:page>')
@blueprint.get('/brands/<brand_id>', defaults={'page': 1})
@blueprint.get('/brands/<brand_id>/pages/<int:page>')
@permission_required(PartyPermission.view)
@templated
def index_for_brand(brand_id, page):


@@ 106,7 106,7 @@ def _get_ticket_sale_stats_by_party_id(
    }


@blueprint.route('/parties/<party_id>')
@blueprint.get('/parties/<party_id>')
@permission_required(PartyPermission.view)
@templated
def view(party_id):


@@ 126,7 126,7 @@ def view(party_id):
    }


@blueprint.route('/for_brand/<brand_id>/create')
@blueprint.get('/for_brand/<brand_id>/create')
@permission_required(PartyPermission.create)
@templated
def create_form(brand_id, erroneous_form=None):


@@ 141,7 141,7 @@ def create_form(brand_id, erroneous_form=None):
    }


@blueprint.route('/for_brand/<brand_id>', methods=['POST'])
@blueprint.post('/for_brand/<brand_id>')
@permission_required(PartyPermission.create)
def create(brand_id):
    """Create a party for that brand."""


@@ 178,7 178,7 @@ def create(brand_id):
    return redirect_to('.index_for_brand', brand_id=brand.id)


@blueprint.route('/parties/<party_id>/update')
@blueprint.get('/parties/<party_id>/update')
@permission_required(PartyPermission.update)
@templated
def update_form(party_id, erroneous_form=None):


@@ 211,7 211,7 @@ def update_form(party_id, erroneous_form=None):
    }


@blueprint.route('/parties/<party_id>', methods=['POST'])
@blueprint.post('/parties/<party_id>')
@permission_required(PartyPermission.update)
def update(party_id):
    """Update a party."""

M byceps/blueprints/admin/seating/views.py => byceps/blueprints/admin/seating/views.py +4 -4
@@ 31,7 31,7 @@ blueprint = create_blueprint('seating_admin', __name__)
register_permission_enum(SeatingPermission)


@blueprint.route('/<party_id>')
@blueprint.get('/<party_id>')
@permission_required(SeatingPermission.view)
@templated
def index_for_party(party_id):


@@ 54,8 54,8 @@ def index_for_party(party_id):
    }


@blueprint.route('/parties/<party_id>/areas', defaults={'page': 1})
@blueprint.route('/parties/<party_id>/areas/pages/<int:page>')
@blueprint.get('/parties/<party_id>/areas', defaults={'page': 1})
@blueprint.get('/parties/<party_id>/areas/pages/<int:page>')
@permission_required(SeatingPermission.view)
@templated
def area_index(party_id, page):


@@ 78,7 78,7 @@ def area_index(party_id, page):
    }


@blueprint.route('/parties/<party_id>/seat_groups')
@blueprint.get('/parties/<party_id>/seat_groups')
@permission_required(SeatingPermission.view)
@templated
def seat_group_index(party_id):

M byceps/blueprints/admin/shop/article/views.py => byceps/blueprints/admin/shop/article/views.py +13 -13
@@ 50,8 50,8 @@ register_permission_enum(ShopArticlePermission)
TAX_RATE_DISPLAY_FACTOR = Decimal('100')


@blueprint.route('/for_shop/<shop_id>', defaults={'page': 1})
@blueprint.route('/for_shop/<shop_id>/pages/<int:page>')
@blueprint.get('/for_shop/<shop_id>', defaults={'page': 1})
@blueprint.get('/for_shop/<shop_id>/pages/<int:page>')
@permission_required(ShopArticlePermission.view)
@templated
def index_for_shop(shop_id, page):


@@ 72,7 72,7 @@ def index_for_shop(shop_id, page):
    }


@blueprint.route('/<uuid:article_id>')
@blueprint.get('/<uuid:article_id>')
@permission_required(ShopArticlePermission.view)
@templated
def view(article_id):


@@ 102,7 102,7 @@ def view(article_id):
    }


@blueprint.route('/<uuid:article_id>/ordered')
@blueprint.get('/<uuid:article_id>/ordered')
@permission_required(ShopArticlePermission.view)
@templated
def view_ordered(article_id):


@@ 152,7 152,7 @@ def view_ordered(article_id):
# create


@blueprint.route('/for_shop/<shop_id>/create')
@blueprint.get('/for_shop/<shop_id>/create')
@permission_required(ShopArticlePermission.create)
@templated
def create_form(shop_id, erroneous_form=None):


@@ 181,7 181,7 @@ def create_form(shop_id, erroneous_form=None):
    }


@blueprint.route('/for_shop/<shop_id>', methods=['POST'])
@blueprint.post('/for_shop/<shop_id>')
@permission_required(ShopArticlePermission.create)
def create(shop_id):
    """Create an article."""


@@ 255,7 255,7 @@ def create(shop_id):
# update


@blueprint.route('/<uuid:article_id>/update')
@blueprint.get('/<uuid:article_id>/update')
@permission_required(ShopArticlePermission.update)
@templated
def update_form(article_id, erroneous_form=None):


@@ 300,7 300,7 @@ def update_form(article_id, erroneous_form=None):
    }


@blueprint.route('/<uuid:article_id>', methods=['POST'])
@blueprint.post('/<uuid:article_id>')
@permission_required(ShopArticlePermission.update)
def update(article_id):
    """Update an article."""


@@ 362,7 362,7 @@ def update(article_id):
# article attachments


@blueprint.route('/<uuid:article_id>/attachments/create')
@blueprint.get('/<uuid:article_id>/attachments/create')
@permission_required(ShopArticlePermission.update)
@templated
def attachment_create_form(article_id, erroneous_form=None):


@@ 390,7 390,7 @@ def attachment_create_form(article_id, erroneous_form=None):
    }


@blueprint.route('/<uuid:article_id>/attachments', methods=['POST'])
@blueprint.post('/<uuid:article_id>/attachments')
@permission_required(ShopArticlePermission.update)
def attachment_create(article_id):
    """Attach an article to another article."""


@@ 423,7 423,7 @@ def attachment_create(article_id):
    return redirect_to('.view', article_id=article.id)


@blueprint.route('/attachments/<uuid:article_id>', methods=['DELETE'])
@blueprint.delete('/attachments/<uuid:article_id>')
@permission_required(ShopArticlePermission.update)
@respond_no_content
def attachment_remove(article_id):


@@ 451,7 451,7 @@ def attachment_remove(article_id):
# article number sequences


@blueprint.route('/number_sequences/for_shop/<shop_id>/create')
@blueprint.get('/number_sequences/for_shop/<shop_id>/create')
@permission_required(ShopArticlePermission.create)
@templated
def create_number_sequence_form(shop_id, erroneous_form=None):


@@ 471,7 471,7 @@ def create_number_sequence_form(shop_id, erroneous_form=None):
    }


@blueprint.route('/number_sequences/for_shop/<shop_id>', methods=['POST'])
@blueprint.post('/number_sequences/for_shop/<shop_id>')
@permission_required(ShopArticlePermission.create)
def create_number_sequence(shop_id):
    """Create an article number sequence."""

M byceps/blueprints/admin/shop/email/views.py => byceps/blueprints/admin/shop/email/views.py +1 -1
@@ 30,7 30,7 @@ blueprint = create_blueprint('shop_email_admin', __name__)
register_permission_enum(ShopPermission)


@blueprint.route('/for_shop/<shop_id>')
@blueprint.get('/for_shop/<shop_id>')
@permission_required(ShopPermission.view)
@templated
def view_for_shop(shop_id):

M byceps/blueprints/admin/shop/order/views.py => byceps/blueprints/admin/shop/order/views.py +15 -17
@@ 41,8 41,8 @@ blueprint = create_blueprint('shop_order_admin', __name__)
register_permission_enum(ShopOrderPermission)


@blueprint.route('/for_shop/<shop_id>', defaults={'page': 1})
@blueprint.route('/for_shop/<shop_id>/pages/<int:page>')
@blueprint.get('/for_shop/<shop_id>', defaults={'page': 1})
@blueprint.get('/for_shop/<shop_id>/pages/<int:page>')
@permission_required(ShopOrderPermission.view)
@templated
def index_for_shop(shop_id, page):


@@ 95,7 95,7 @@ def index_for_shop(shop_id, page):
    }


@blueprint.route('/<uuid:order_id>')
@blueprint.get('/<uuid:order_id>')
@permission_required(ShopOrderPermission.view)
@templated
def view(order_id):


@@ 134,7 134,7 @@ def view(order_id):
# export


@blueprint.route('/<uuid:order_id>/export')
@blueprint.get('/<uuid:order_id>/export')
@permission_required(ShopOrderPermission.view)
def export(order_id):
    """Export the order as an XML document."""


@@ 152,7 152,7 @@ def export(order_id):
# flags


@blueprint.route('/<uuid:order_id>/flags/invoiced', methods=['POST'])
@blueprint.post('/<uuid:order_id>/flags/invoiced')
@permission_required(ShopOrderPermission.update)
@respond_no_content
def set_invoiced_flag(order_id):


@@ 170,7 170,7 @@ def set_invoiced_flag(order_id):
    )


@blueprint.route('/<uuid:order_id>/flags/invoiced', methods=['DELETE'])
@blueprint.delete('/<uuid:order_id>/flags/invoiced')
@permission_required(ShopOrderPermission.update)
@respond_no_content
def unset_invoiced_flag(order_id):


@@ 188,7 188,7 @@ def unset_invoiced_flag(order_id):
    )


@blueprint.route('/<uuid:order_id>/flags/shipped', methods=['POST'])
@blueprint.post('/<uuid:order_id>/flags/shipped')
@permission_required(ShopOrderPermission.update)
@respond_no_content
def set_shipped_flag(order_id):


@@ 206,7 206,7 @@ def set_shipped_flag(order_id):
    )


@blueprint.route('/<uuid:order_id>/flags/shipped', methods=['DELETE'])
@blueprint.delete('/<uuid:order_id>/flags/shipped')
@permission_required(ShopOrderPermission.update)
@respond_no_content
def unset_shipped_flag(order_id):


@@ 228,7 228,7 @@ def unset_shipped_flag(order_id):
# cancel


@blueprint.route('/<uuid:order_id>/cancel')
@blueprint.get('/<uuid:order_id>/cancel')
@permission_required(ShopOrderPermission.cancel)
@templated
def cancel_form(order_id, erroneous_form=None):


@@ 258,7 258,7 @@ def cancel_form(order_id, erroneous_form=None):
    }


@blueprint.route('/<uuid:order_id>/cancel', methods=['POST'])
@blueprint.post('/<uuid:order_id>/cancel')
@permission_required(ShopOrderPermission.cancel)
def cancel(order_id):
    """Set the payment status of a single order to 'canceled' and


@@ 305,7 305,7 @@ def cancel(order_id):
# mark as paid


@blueprint.route('/<uuid:order_id>/mark_as_paid')
@blueprint.get('/<uuid:order_id>/mark_as_paid')
@permission_required(ShopOrderPermission.mark_as_paid)
@templated
def mark_as_paid_form(order_id, erroneous_form=None):


@@ 330,7 330,7 @@ def mark_as_paid_form(order_id, erroneous_form=None):
    }


@blueprint.route('/<uuid:order_id>/mark_as_paid', methods=['POST'])
@blueprint.post('/<uuid:order_id>/mark_as_paid')
@permission_required(ShopOrderPermission.mark_as_paid)
def mark_as_paid(order_id):
    """Set the payment status of a single order to 'paid'."""


@@ 364,9 364,7 @@ def mark_as_paid(order_id):
# email


@blueprint.route(
    '/<uuid:order_id>/resend_incoming_order_email', methods=['POST']
)
@blueprint.post('/<uuid:order_id>/resend_incoming_order_email')
@permission_required(ShopOrderPermission.update)
@respond_no_content
def resend_email_for_incoming_order_to_orderer(order_id):


@@ 394,7 392,7 @@ def resend_email_for_incoming_order_to_orderer(order_id):
# order number sequences


@blueprint.route('/number_sequences/for_shop/<shop_id>/create')
@blueprint.get('/number_sequences/for_shop/<shop_id>/create')
@permission_required(ShopPermission.update)
@templated
def create_number_sequence_form(shop_id, erroneous_form=None):


@@ 412,7 410,7 @@ def create_number_sequence_form(shop_id, erroneous_form=None):
    }


@blueprint.route('/number_sequences/for_shop/<shop_id>', methods=['POST'])
@blueprint.post('/number_sequences/for_shop/<shop_id>')
@permission_required(ShopPermission.update)
def create_number_sequence(shop_id):
    """Create an order number sequence."""

M byceps/blueprints/admin/shop/shipping/views.py => byceps/blueprints/admin/shop/shipping/views.py +1 -1
@@ 21,7 21,7 @@ from ..order.authorization import ShopOrderPermission
blueprint = create_blueprint('shop_shipping_admin', __name__)


@blueprint.route('/for_shop/<shop_id>')
@blueprint.get('/for_shop/<shop_id>')
@permission_required(ShopOrderPermission.view)
@templated
def view_for_shop(shop_id):

M byceps/blueprints/admin/shop/shop/views.py => byceps/blueprints/admin/shop/shop/views.py +3 -3
@@ 32,7 32,7 @@ blueprint = create_blueprint('shop_shop_admin', __name__)
register_permission_enum(ShopPermission)


@blueprint.route('/for_shop/<shop_id>')
@blueprint.get('/for_shop/<shop_id>')
@permission_required(ShopPermission.view)
@templated
def view(shop_id):


@@ 56,7 56,7 @@ def view(shop_id):
    }


@blueprint.route('/for_brand/<brand_id>')
@blueprint.get('/for_brand/<brand_id>')
@permission_required(ShopPermission.view)
@templated
def view_for_brand(brand_id):


@@ 73,7 73,7 @@ def view_for_brand(brand_id):
    }


@blueprint.route('/for_brand/<brand_id>', methods=['POST'])
@blueprint.post('/for_brand/<brand_id>')
@permission_required(ShopPermission.create)
@respond_no_content_with_location
def create(brand_id):

M byceps/blueprints/admin/shop/storefront/views.py => byceps/blueprints/admin/shop/storefront/views.py +6 -6
@@ 27,7 27,7 @@ from .forms import StorefrontCreateForm, StorefrontUpdateForm
blueprint = create_blueprint('shop_storefront_admin', __name__)


@blueprint.route('/for_shop/<shop_id>')
@blueprint.get('/for_shop/<shop_id>')
@permission_required(ShopPermission.view)
@templated
def index_for_shop(shop_id):


@@ 58,7 58,7 @@ def _get_order_number_prefixes_by_sequence_id(storefronts, shop_id):
    return {seq.id: seq.prefix for seq in sequences}


@blueprint.route('/<storefront_id>')
@blueprint.get('/<storefront_id>')
@permission_required(ShopPermission.view)
@templated
def view(storefront_id):


@@ 82,7 82,7 @@ def view(storefront_id):
    }


@blueprint.route('/for_shop/<shop_id>/create')
@blueprint.get('/for_shop/<shop_id>/create')
@permission_required(ShopPermission.create)
@templated
def create_form(shop_id, erroneous_form=None):


@@ 109,7 109,7 @@ def create_form(shop_id, erroneous_form=None):
    }


@blueprint.route('/for_shop/<shop_id>', methods=['POST'])
@blueprint.post('/for_shop/<shop_id>')
@permission_required(ShopPermission.create)
def create(shop_id):
    """Create a storefront."""


@@ 174,7 174,7 @@ def create(shop_id):
    return redirect_to('.view', storefront_id=storefront.id)


@blueprint.route('/<storefront_id>/update')
@blueprint.get('/<storefront_id>/update')
@permission_required(ShopPermission.update)
@templated
def update_form(storefront_id, erroneous_form=None):


@@ 206,7 206,7 @@ def update_form(storefront_id, erroneous_form=None):
    }


@blueprint.route('/<storefront_id>', methods=['POST'])
@blueprint.post('/<storefront_id>')
@permission_required(ShopPermission.update)
def update(storefront_id):
    """Update a storefront."""

M byceps/blueprints/admin/site/views.py => byceps/blueprints/admin/site/views.py +7 -7
@@ 40,7 40,7 @@ blueprint = create_blueprint('site_admin', __name__)
register_permission_enum(SitePermission)


@blueprint.route('/')
@blueprint.get('/')
@permission_required(SitePermission.view)
@templated
def index():


@@ 65,7 65,7 @@ def index():
    }


@blueprint.route('/for_brand/<brand_id>')
@blueprint.get('/for_brand/<brand_id>')
@permission_required(SitePermission.view)
@templated
def index_for_brand(brand_id):


@@ 121,7 121,7 @@ def _get_storefronts_by_site_id(sites):
    }


@blueprint.route('/sites/<site_id>')
@blueprint.get('/sites/<site_id>')
@permission_required(SitePermission.view)
@templated
def view(site_id):


@@ 162,7 162,7 @@ def view(site_id):
    }


@blueprint.route('/sites/create/for_brand/<brand_id>')
@blueprint.get('/sites/create/for_brand/<brand_id>')
@permission_required(SitePermission.create)
@templated
def create_form(brand_id, erroneous_form=None):


@@ 178,7 178,7 @@ def create_form(brand_id, erroneous_form=None):
    }


@blueprint.route('/sites/for_brand/<brand_id>', methods=['POST'])
@blueprint.post('/sites/for_brand/<brand_id>')
@permission_required(SitePermission.create)
def create(brand_id):
    """Create a site."""


@@ 235,7 235,7 @@ def create(brand_id):
    return redirect_to('.view', site_id=site.id)


@blueprint.route('/sites/<site_id>/update')
@blueprint.get('/sites/<site_id>/update')
@permission_required(SitePermission.update)
@templated
def update_form(site_id, erroneous_form=None):


@@ 252,7 252,7 @@ def update_form(site_id, erroneous_form=None):
    }


@blueprint.route('/sites/<site_id>', methods=['POST'])
@blueprint.post('/sites/<site_id>')
@permission_required(SitePermission.update)
def update(site_id):
    """Update the site."""

M byceps/blueprints/admin/snippet/views.py => byceps/blueprints/admin/snippet/views.py +19 -23
@@ 46,7 46,7 @@ register_permission_enum(SnippetMountpointPermission)
register_permission_enum(SnippetPermission)


@blueprint.route('/for_scope/<scope_type>/<scope_name>')
@blueprint.get('/for_scope/<scope_type>/<scope_name>')
@permission_required(SnippetPermission.view)
@templated
def index_for_scope(scope_type, scope_name):


@@ 68,7 68,7 @@ def index_for_scope(scope_type, scope_name):
    }


@blueprint.route('/snippets/<uuid:snippet_id>/current_version')
@blueprint.get('/snippets/<uuid:snippet_id>/current_version')
@permission_required(SnippetPermission.view)
def view_current_version(snippet_id):
    """Show the current version of the snippet."""


@@ 79,7 79,7 @@ def view_current_version(snippet_id):
    return view_version(version.id)


@blueprint.route('/versions/<uuid:snippet_version_id>')
@blueprint.get('/versions/<uuid:snippet_version_id>')
@permission_required(SnippetPermission.view_history)
@templated
def view_version(snippet_version_id):


@@ 119,7 119,7 @@ def view_version(snippet_version_id):
    return context


@blueprint.route('/snippets/<uuid:snippet_id>/history')
@blueprint.get('/snippets/<uuid:snippet_id>/history')
@permission_required(SnippetPermission.view_history)
@templated
def history(snippet_id):


@@ 146,7 146,7 @@ def history(snippet_id):
# document


@blueprint.route('/for_scope/<scope_type>/<scope_name>/documents/create')
@blueprint.get('/for_scope/<scope_type>/<scope_name>/documents/create')
@permission_required(SnippetPermission.create)
@templated
def create_document_form(scope_type, scope_name):


@@ 166,9 166,7 @@ def create_document_form(scope_type, scope_name):
    }


@blueprint.route(
    '/for_scope/<scope_type>/<scope_name>/documents', methods=['POST']
)
@blueprint.post('/for_scope/<scope_type>/<scope_name>/documents')
@permission_required(SnippetPermission.create)
def create_document(scope_type, scope_name):
    """Create a document."""


@@ 204,7 202,7 @@ def create_document(scope_type, scope_name):
    return redirect_to('.view_version', snippet_version_id=version.id)


@blueprint.route('/documents/<uuid:snippet_id>/update')
@blueprint.get('/documents/<uuid:snippet_id>/update')
@permission_required(SnippetPermission.update)
@templated
def update_document_form(snippet_id):


@@ 228,7 226,7 @@ def update_document_form(snippet_id):
    }


@blueprint.route('/documents/<uuid:snippet_id>', methods=['POST'])
@blueprint.post('/documents/<uuid:snippet_id>')
@permission_required(SnippetPermission.update)
def update_document(snippet_id):
    """Update a document."""


@@ 263,7 261,7 @@ def update_document(snippet_id):
    return redirect_to('.view_version', snippet_version_id=version.id)


@blueprint.route(
@blueprint.get(
    '/documents/<uuid:from_version_id>/compare_to/<uuid:to_version_id>'
)
@permission_required(SnippetPermission.view_history)


@@ 303,7 301,7 @@ def compare_documents(from_version_id, to_version_id):
# fragment


@blueprint.route('/for_scope/<scope_type>/<scope_name>/fragments/create')
@blueprint.get('/for_scope/<scope_type>/<scope_name>/fragments/create')
@permission_required(SnippetPermission.create)
@templated
def create_fragment_form(scope_type, scope_name):


@@ 323,9 321,7 @@ def create_fragment_form(scope_type, scope_name):
    }


@blueprint.route(
    '/for_scope/<scope_type>/<scope_name>/fragments', methods=['POST']
)
@blueprint.post('/for_scope/<scope_type>/<scope_name>/fragments')
@permission_required(SnippetPermission.create)
def create_fragment(scope_type, scope_name):
    """Create a fragment."""


@@ 352,7 348,7 @@ def create_fragment(scope_type, scope_name):
    return redirect_to('.view_version', snippet_version_id=version.id)


@blueprint.route('/fragments/<uuid:snippet_id>/update')
@blueprint.get('/fragments/<uuid:snippet_id>/update')
@permission_required(SnippetPermission.update)
@templated
def update_fragment_form(snippet_id):


@@ 376,7 372,7 @@ def update_fragment_form(snippet_id):
    }


@blueprint.route('/fragments/<uuid:snippet_id>', methods=['POST'])
@blueprint.post('/fragments/<uuid:snippet_id>')
@permission_required(SnippetPermission.update)
def update_fragment(snippet_id):
    """Update a fragment."""


@@ 403,7 399,7 @@ def update_fragment(snippet_id):
    return redirect_to('.view_version', snippet_version_id=version.id)


@blueprint.route(
@blueprint.get(
    '/fragments/<uuid:from_version_id>/compare_to/<uuid:to_version_id>'
)
@permission_required(SnippetPermission.view_history)


@@ 435,7 431,7 @@ def compare_fragments(from_version_id, to_version_id):
# delete


@blueprint.route('/snippets/<uuid:snippet_id>', methods=['DELETE'])
@blueprint.delete('/snippets/<uuid:snippet_id>')
@permission_required(SnippetPermission.delete)
@respond_no_content_with_location
def delete_snippet(snippet_id):


@@ 471,7 467,7 @@ def delete_snippet(snippet_id):
# mountpoint


@blueprint.route('/mountpoints/<site_id>')
@blueprint.get('/mountpoints/<site_id>')
@permission_required(SnippetPermission.view)
@templated
def index_mountpoints(site_id):


@@ 497,7 493,7 @@ def index_mountpoints(site_id):
    }


@blueprint.route('/snippets/<uuid:snippet_id>/mountpoints/create')
@blueprint.get('/snippets/<uuid:snippet_id>/mountpoints/create')
@permission_required(SnippetMountpointPermission.create)
@templated
def create_mountpoint_form(snippet_id, *, erroneous_form=None):


@@ 520,7 516,7 @@ def create_mountpoint_form(snippet_id, *, erroneous_form=None):
    }


@blueprint.route('/snippets/<uuid:snippet_id>/mountpoints', methods=['POST'])
@blueprint.post('/snippets/<uuid:snippet_id>/mountpoints')
@permission_required(SnippetMountpointPermission.create)
def create_mountpoint(snippet_id):
    """Create a mountpoint."""


@@ 547,7 543,7 @@ def create_mountpoint(snippet_id):
    return redirect_to('.index_mountpoints', site_id=site_id)


@blueprint.route('/mountpoints/<uuid:mountpoint_id>', methods=['DELETE'])
@blueprint.delete('/mountpoints/<uuid:mountpoint_id>')
@permission_required(SnippetMountpointPermission.delete)
@respond_no_content
def delete_mountpoint(mountpoint_id):

M byceps/blueprints/admin/terms/views.py => byceps/blueprints/admin/terms/views.py +3 -3
@@ 26,7 26,7 @@ blueprint = create_blueprint('terms_admin', __name__)
register_permission_enum(TermsPermission)


@blueprint.route('/documents/<document_id>')
@blueprint.get('/documents/<document_id>')
@permission_required(TermsPermission.view)
@templated
def view_document(document_id):


@@ 63,7 63,7 @@ def _add_version_creators(versions):
        version.creator = creators_by_id[version.snippet_version.creator_id]


@blueprint.route('/versions/<uuid:version_id>')
@blueprint.get('/versions/<uuid:version_id>')
@permission_required(TermsPermission.view)
@templated
def view_version(version_id):


@@ 75,7 75,7 @@ def view_version(version_id):
    }


@blueprint.route('/versions/<uuid:version_id>/body.html')
@blueprint.get('/versions/<uuid:version_id>/body.html')
@permission_required(TermsPermission.view)
@templated
def view_version_body_html(version_id):

M byceps/blueprints/admin/ticketing/category/views.py => byceps/blueprints/admin/ticketing/category/views.py +5 -5
@@ 24,7 24,7 @@ from .forms import CreateOrUpdateForm
blueprint = create_blueprint('ticketing_category_admin', __name__)


@blueprint.route('/for_party/<party_id>')
@blueprint.get('/for_party/<party_id>')
@permission_required(TicketingPermission.administrate)
@templated
def index(party_id):


@@ 43,7 43,7 @@ def index(party_id):
    }


@blueprint.route('/for_party/<party_id>/create')
@blueprint.get('/for_party/<party_id>/create')
@permission_required(TicketingPermission.administrate)
@templated
def create_form(party_id, erroneous_form=None):


@@ 58,7 58,7 @@ def create_form(party_id, erroneous_form=None):
    }


@blueprint.route('/for_party/<party_id>', methods=['POST'])
@blueprint.post('/for_party/<party_id>')
@permission_required(TicketingPermission.administrate)
def create(party_id):
    """Create a ticket category."""


@@ 82,7 82,7 @@ def create(party_id):
    return redirect_to('.index', party_id=party.id)


@blueprint.route('/categories/<uuid:category_id>/update')
@blueprint.get('/categories/<uuid:category_id>/update')
@permission_required(TicketingPermission.administrate)
@templated
def update_form(category_id, erroneous_form=None):


@@ 102,7 102,7 @@ def update_form(category_id, erroneous_form=None):
    }


@blueprint.route('/categories/<uuid:category_id>', methods=['POST'])
@blueprint.post('/categories/<uuid:category_id>')
@permission_required(TicketingPermission.administrate)
def update(category_id):
    """Update the category."""

M byceps/blueprints/admin/ticketing/checkin/views.py => byceps/blueprints/admin/ticketing/checkin/views.py +3 -8
@@ 33,7 33,7 @@ blueprint = create_blueprint('ticketing_checkin_admin', __name__)
MINIMUM_AGE_IN_YEARS = 18


@blueprint.route('/for_party/<party_id>')
@blueprint.get('/for_party/<party_id>')
@permission_required(TicketingPermission.checkin)
@templated
def index(party_id):


@@ 105,10 105,7 @@ def _get_tickets_for_users(party_id, users):
        )


@blueprint.route(
    '/for_party/<party_id>/tickets/<uuid:ticket_id>/check_in_user',
    methods=['POST'],
)
@blueprint.post('/for_party/<party_id>/tickets/<uuid:ticket_id>/check_in_user')
@permission_required(TicketingPermission.checkin)
@respond_no_content
def check_in_user(party_id, ticket_id):


@@ 164,9 161,7 @@ def check_in_user(party_id, ticket_id):
        )


@blueprint.route(
    '/tickets/<uuid:ticket_id>/revert_user_check_in', methods=['POST']
)
@blueprint.post('/tickets/<uuid:ticket_id>/revert_user_check_in')
@permission_required(TicketingPermission.checkin)
@respond_no_content
def revert_user_check_in(ticket_id):

M byceps/blueprints/admin/ticketing/views.py => byceps/blueprints/admin/ticketing/views.py +10 -10
@@ 37,8 37,8 @@ register_permission_enum(TicketingPermission)
# tickets


@blueprint.route('/tickets/for_party/<party_id>', defaults={'page': 1})
@blueprint.route('/tickets/for_party/<party_id>/pages/<int:page>')
@blueprint.get('/tickets/for_party/<party_id>', defaults={'page': 1})
@blueprint.get('/tickets/for_party/<party_id>/pages/<int:page>')
@permission_required(TicketingPermission.view)
@templated
def index_for_party(party_id, page):


@@ 60,7 60,7 @@ def index_for_party(party_id, page):
    }


@blueprint.route('/tickets/<uuid:ticket_id>')
@blueprint.get('/tickets/<uuid:ticket_id>')
@permission_required(TicketingPermission.view)
@templated
def view_ticket(ticket_id):


@@ 90,7 90,7 @@ def view_ticket(ticket_id):
# ticket code


@blueprint.route('/tickets/<uuid:ticket_id>/code')
@blueprint.get('/tickets/<uuid:ticket_id>/code')
@permission_required(TicketingPermission.administrate)
@templated
def update_code_form(ticket_id, erroneous_form=None):


@@ 116,7 116,7 @@ def update_code_form(ticket_id, erroneous_form=None):
    }


@blueprint.route('/tickets/<uuid:ticket_id>/code', methods=['POST'])
@blueprint.post('/tickets/<uuid:ticket_id>/code')
@permission_required(TicketingPermission.administrate)
def update_code(ticket_id):
    """Set a custom code for the ticket."""


@@ 153,7 153,7 @@ def update_code(ticket_id):
# user appointment


@blueprint.route('/tickets/<uuid:ticket_id>/appoint_user')
@blueprint.get('/tickets/<uuid:ticket_id>/appoint_user')
@permission_required(TicketingPermission.checkin)
@templated
def appoint_user_form(ticket_id, erroneous_form=None):


@@ 171,7 171,7 @@ def appoint_user_form(ticket_id, erroneous_form=None):
    }


@blueprint.route('/tickets/<uuid:ticket_id>/user', methods=['POST'])
@blueprint.post('/tickets/<uuid:ticket_id>/user')
@permission_required(TicketingPermission.checkin)
def appoint_user(ticket_id):
    """Appoint a user for the ticket."""


@@ 200,8 200,8 @@ def appoint_user(ticket_id):
# bundles


@blueprint.route('/bundles/for_party/<party_id>', defaults={'page': 1})
@blueprint.route('/bundles/for_party/<party_id>/pages/<int:page>')
@blueprint.get('/bundles/for_party/<party_id>', defaults={'page': 1})
@blueprint.get('/bundles/for_party/<party_id>/pages/<int:page>')
@permission_required(TicketingPermission.view)
@templated
def index_bundle_for_party(party_id, page):


@@ 220,7 220,7 @@ def index_bundle_for_party(party_id, page):
    }


@blueprint.route('/bundles/<uuid:bundle_id>')
@blueprint.get('/bundles/<uuid:bundle_id>')
@permission_required(TicketingPermission.view)
@templated
def view_bundle(bundle_id):

M byceps/blueprints/admin/tourney/category/views.py => byceps/blueprints/admin/tourney/category/views.py +7 -7
@@ 28,7 28,7 @@ blueprint = create_blueprint('tourney_category_admin', __name__)
register_permission_enum(TourneyCategoryPermission)


@blueprint.route('/for_party/<party_id>')
@blueprint.get('/for_party/<party_id>')
@permission_required(TourneyCategoryPermission.view)
@templated
def index(party_id):


@@ 43,7 43,7 @@ def index(party_id):
    }


@blueprint.route('/for_party/<party_id>/create')
@blueprint.get('/for_party/<party_id>/create')
@permission_required(TourneyCategoryPermission.administrate)
@templated
def create_form(party_id, erroneous_form=None):


@@ 58,7 58,7 @@ def create_form(party_id, erroneous_form=None):
    }


@blueprint.route('/for_party/<party_id>', methods=['POST'])
@blueprint.post('/for_party/<party_id>')
@permission_required(TourneyCategoryPermission.administrate)
def create(party_id):
    """Create a category."""


@@ 81,7 81,7 @@ def create(party_id):
    return redirect_to('.index', party_id=category.party_id)


@blueprint.route('/categories/<uuid:category_id>/update')
@blueprint.get('/categories/<uuid:category_id>/update')
@permission_required(TourneyCategoryPermission.administrate)
@templated
def update_form(category_id, erroneous_form=None):


@@ 99,7 99,7 @@ def update_form(category_id, erroneous_form=None):
    }


@blueprint.route('/categories/<uuid:category_id>', methods=['POST'])
@blueprint.post('/categories/<uuid:category_id>')
@permission_required(TourneyCategoryPermission.administrate)
def update(category_id):
    """Update a category."""


@@ 120,7 120,7 @@ def update(category_id):
    return redirect_to('.index', party_id=category.party_id)


@blueprint.route('/categories/<uuid:category_id>/up', methods=['POST'])
@blueprint.post('/categories/<uuid:category_id>/up')
@permission_required(TourneyCategoryPermission.administrate)
@respond_no_content
def move_up(category_id):


@@ 144,7 144,7 @@ def move_up(category_id):
        )


@blueprint.route('/categories/<uuid:category_id>/down', methods=['POST'])
@blueprint.post('/categories/<uuid:category_id>/down')
@permission_required(TourneyCategoryPermission.administrate)
@respond_no_content
def move_down(category_id):

M byceps/blueprints/admin/tourney/tourney/views.py => byceps/blueprints/admin/tourney/tourney/views.py +5 -5
@@ 32,7 32,7 @@ blueprint = create_blueprint('tourney_tourney_admin', __name__)
register_permission_enum(TourneyPermission)


@blueprint.route('/for_party/<party_id>')
@blueprint.get('/for_party/<party_id>')
@permission_required(TourneyPermission.view)
@templated
def index(party_id):


@@ 47,7 47,7 @@ def index(party_id):
    }


@blueprint.route('/for_party/<party_id>/create')
@blueprint.get('/for_party/<party_id>/create')
@permission_required(TourneyPermission.administrate)
@templated
def create_form(party_id, erroneous_form=None):


@@ 63,7 63,7 @@ def create_form(party_id, erroneous_form=None):
    }


@blueprint.route('/for_party/<party_id>', methods=['POST'])
@blueprint.post('/for_party/<party_id>')
@permission_required(TourneyPermission.administrate)
def create(party_id):
    """Create a tourney."""


@@ 101,7 101,7 @@ def create(party_id):
    return redirect_to('.index', party_id=tourney.party_id)


@blueprint.route('/tourneys/<tourney_id>/update')
@blueprint.get('/tourneys/<tourney_id>/update')
@permission_required(TourneyPermission.administrate)
@templated
def update_form(tourney_id, erroneous_form=None):


@@ 133,7 133,7 @@ def update_form(tourney_id, erroneous_form=None):
    }


@blueprint.route('/tourneys/<tourney_id>', methods=['POST'])
@blueprint.post('/tourneys/<tourney_id>')
@permission_required(TourneyPermission.administrate)
def update(tourney_id):
    """Update the tourney."""

M byceps/blueprints/admin/user/views.py => byceps/blueprints/admin/user/views.py +23 -23
@@ 55,8 55,8 @@ blueprint = create_blueprint('user_admin', __name__)
register_permission_enum(UserPermission)


@blueprint.route('/', defaults={'page': 1})
@blueprint.route('/pages/<int:page>')
@blueprint.get('/', defaults={'page': 1})
@blueprint.get('/pages/<int:page>')
@permission_required(UserPermission.view)
@templated
def index(page):


@@ 93,7 93,7 @@ def index(page):
    }


@blueprint.route('/<uuid:user_id>')
@blueprint.get('/<uuid:user_id>')
@permission_required(UserPermission.view)
@templated
def view(user_id):


@@ 144,7 144,7 @@ def _calculate_days_since(dt: Optional[datetime]) -> Optional[int]:
    return (datetime.utcnow().date() - dt.date()).days


@blueprint.route('/create')
@blueprint.get('/create')
@permission_required(UserPermission.create)
@templated
def create_account_form(erroneous_form=None):


@@ 155,7 155,7 @@ def create_account_form(erroneous_form=None):
    return {'form': form}


@blueprint.route('/', methods=['POST'])
@blueprint.post('/')
@permission_required(UserPermission.create)
def create_account():
    """Create a user account."""


@@ 219,7 219,7 @@ def create_account():
    return redirect_to('.view', user_id=user.id)


@blueprint.route('/<uuid:user_id>/password')
@blueprint.get('/<uuid:user_id>/password')
@permission_required(UserPermission.set_password)
@templated
def set_password_form(user_id, erroneous_form=None):


@@ 234,7 234,7 @@ def set_password_form(user_id, erroneous_form=None):
    }


@blueprint.route('/<uuid:user_id>/password', methods=['POST'])
@blueprint.post('/<uuid:user_id>/password')
@permission_required(UserPermission.set_password)
def set_password(user_id):
    """Set a new password for the user."""


@@ 259,7 259,7 @@ def set_password(user_id):
    return redirect_to('.view', user_id=user.id)


@blueprint.route('/<uuid:user_id>/initialize', methods=['POST'])
@blueprint.post('/<uuid:user_id>/initialize')
@permission_required(UserPermission.administrate)
@respond_no_content
def initialize_account(user_id):


@@ 278,7 278,7 @@ def initialize_account(user_id):
    )


@blueprint.route('/<uuid:user_id>/suspend')
@blueprint.get('/<uuid:user_id>/suspend')
@permission_required(UserPermission.administrate)
@templated
def suspend_account_form(user_id, erroneous_form=None):


@@ 302,7 302,7 @@ def suspend_account_form(user_id, erroneous_form=None):
    }


@blueprint.route('/<uuid:user_id>/suspend', methods=['POST'])
@blueprint.post('/<uuid:user_id>/suspend')
@permission_required(UserPermission.administrate)
def suspend_account(user_id):
    """Suspend the user account."""


@@ 337,7 337,7 @@ def suspend_account(user_id):
    return redirect_to('.view', user_id=user.id)


@blueprint.route('/<uuid:user_id>/unsuspend')
@blueprint.get('/<uuid:user_id>/unsuspend')
@permission_required(UserPermission.administrate)
@templated
def unsuspend_account_form(user_id, erroneous_form=None):


@@ 361,7 361,7 @@ def unsuspend_account_form(user_id, erroneous_form=None):
    }


@blueprint.route('/<uuid:user_id>/unsuspend', methods=['POST'])
@blueprint.post('/<uuid:user_id>/unsuspend')
@permission_required(UserPermission.administrate)
def unsuspend_account(user_id):
    """Unsuspend the user account."""


@@ 398,7 398,7 @@ def unsuspend_account(user_id):
    return redirect_to('.view', user_id=user.id)


@blueprint.route('/<uuid:user_id>/delete')
@blueprint.get('/<uuid:user_id>/delete')
@permission_required(UserPermission.administrate)
@templated
def delete_account_form(user_id, erroneous_form=None):


@@ 422,7 422,7 @@ def delete_account_form(user_id, erroneous_form=None):
    }


@blueprint.route('/<uuid:user_id>/delete', methods=['POST'])
@blueprint.post('/<uuid:user_id>/delete')
@permission_required(UserPermission.administrate)
def delete_account(user_id):
    """Delete the user account."""


@@ 457,7 457,7 @@ def delete_account(user_id):
    return redirect_to('.view', user_id=user.id)


@blueprint.route('/<uuid:user_id>/change_email_address')
@blueprint.get('/<uuid:user_id>/change_email_address')
@permission_required(UserPermission.administrate)
@templated
def change_email_address_form(user_id, erroneous_form=None):


@@ 472,7 472,7 @@ def change_email_address_form(user_id, erroneous_form=None):
    }


@blueprint.route('/<uuid:user_id>/change_email_address', methods=['POST'])
@blueprint.post('/<uuid:user_id>/change_email_address')
@permission_required(UserPermission.administrate)
def change_email_address(user_id):
    """Change the user's e-mail address."""


@@ 502,7 502,7 @@ def change_email_address(user_id):
    return redirect_to('.view', user_id=user.id)


@blueprint.route('/<uuid:user_id>/change_screen_name')
@blueprint.get('/<uuid:user_id>/change_screen_name')
@permission_required(UserPermission.administrate)
@templated
def change_screen_name_form(user_id, erroneous_form=None):


@@ 517,7 517,7 @@ def change_screen_name_form(user_id, erroneous_form=None):
    }


@blueprint.route('/<uuid:user_id>/change_screen_name', methods=['POST'])
@blueprint.post('/<uuid:user_id>/change_screen_name')
@permission_required(UserPermission.administrate)
def change_screen_name(user_id):
    """Change the user's screen name."""


@@ 548,7 548,7 @@ def change_screen_name(user_id):
    return redirect_to('.view', user_id=user.id)


@blueprint.route('/<uuid:user_id>/permissions')
@blueprint.get('/<uuid:user_id>/permissions')
@permission_required(UserPermission.view)
@templated
def view_permissions(user_id):


@@ 567,7 567,7 @@ def view_permissions(user_id):
    }


@blueprint.route('/<uuid:user_id>/roles/assignment')
@blueprint.get('/<uuid:user_id>/roles/assignment')
@permission_required(RolePermission.assign)
@templated
def manage_roles(user_id):


@@ 587,7 587,7 @@ def manage_roles(user_id):
    }


@blueprint.route('/<uuid:user_id>/roles/<role_id>', methods=['POST'])
@blueprint.post('/<uuid:user_id>/roles/<role_id>')
@permission_required(RolePermission.assign)
@respond_no_content
def role_assign(user_id, role_id):


@@ 609,7 609,7 @@ def role_assign(user_id, role_id):
    )


@blueprint.route('/<uuid:user_id>/roles/<role_id>', methods=['DELETE'])
@blueprint.delete('/<uuid:user_id>/roles/<role_id>')
@permission_required(RolePermission.assign)
@respond_no_content
def role_deassign(user_id, role_id):


@@ 631,7 631,7 @@ def role_deassign(user_id, role_id):
    )


@blueprint.route('/<uuid:user_id>/events')
@blueprint.get('/<uuid:user_id>/events')
@permission_required(UserPermission.view)
@templated
def view_events(user_id):

M byceps/blueprints/admin/user_badge/views.py => byceps/blueprints/admin/user_badge/views.py +8 -8
@@ 33,7 33,7 @@ register_permission_enum(UserBadgePermission)
# badges


@blueprint.route('/badges')
@blueprint.get('/badges')
@permission_required(UserBadgePermission.view)
@templated
def index():


@@ 69,7 69,7 @@ def index():
    }


@blueprint.route('/badges/<uuid:badge_id>')
@blueprint.get('/badges/<uuid:badge_id>')
@permission_required(UserBadgePermission.view)
@templated
def view(badge_id):


@@ 93,7 93,7 @@ def view(badge_id):
    }


@blueprint.route('/create')
@blueprint.get('/create')
@permission_required(UserBadgePermission.create)
@templated
def create_form(erroneous_form=None):


@@ 106,7 106,7 @@ def create_form(erroneous_form=None):
    }


@blueprint.route('/badges', methods=['POST'])
@blueprint.post('/badges')
@permission_required(UserBadgePermission.create)
def create():
    """Create a user badge."""


@@ 147,7 147,7 @@ def create():
    return redirect_to('.index')


@blueprint.route('/badges/<uuid:badge_id>/update')
@blueprint.get('/badges/<uuid:badge_id>/update')
@permission_required(UserBadgePermission.update)
@templated
def update_form(badge_id, erroneous_form=None):


@@ 163,7 163,7 @@ def update_form(badge_id, erroneous_form=None):
    }


@blueprint.route('/badges/<uuid:badge_id>', methods=['POST'])
@blueprint.post('/badges/<uuid:badge_id>')
@permission_required(UserBadgePermission.update)
def update(badge_id):
    """Update a badge."""


@@ 203,7 203,7 @@ def _set_brand_ids_on_form(form):
# awarding


@blueprint.route('/awardings/to/<uuid:user_id>')
@blueprint.get('/awardings/to/<uuid:user_id>')
@permission_required(UserBadgePermission.award)
@templated
def award_form(user_id, erroneous_form=None):


@@ 221,7 221,7 @@ def award_form(user_id, erroneous_form=None):
    }


@blueprint.route('/awardings/to/<uuid:user_id>', methods=['POST'])
@blueprint.post('/awardings/to/<uuid:user_id>')
@permission_required(UserBadgePermission.award)
def award(user_id):
    """Award a badge to a user."""

M byceps/blueprints/admin/webhook/views.py => byceps/blueprints/admin/webhook/views.py +6 -6
@@ 36,7 36,7 @@ register_permission_enum(WebhookPermission)
WEBHOOK_EVENT_NAMES = frozenset(EVENT_TYPES_TO_NAMES.values())


@blueprint.route('/')
@blueprint.get('/')
@permission_required(WebhookPermission.view)
@templated
def index():


@@ 50,7 50,7 @@ def index():
    }


@blueprint.route('/create')
@blueprint.get('/create')
@permission_required(WebhookPermission.administrate)
@templated
def create_form(erroneous_form=None):


@@ 66,7 66,7 @@ def create_form(erroneous_form=None):
    }


@blueprint.route('/', methods=['POST'])
@blueprint.post('/')
@permission_required(WebhookPermission.administrate)
def create():
    """Create a webhook."""


@@ 97,7 97,7 @@ def create():
    return redirect_to('.index')


@blueprint.route('/webhooks/<uuid:webhook_id>/update')
@blueprint.get('/webhooks/<uuid:webhook_id>/update')
@permission_required(WebhookPermission.administrate)
@templated
def update_form(webhook_id, erroneous_form=None):


@@ 126,7 126,7 @@ def update_form(webhook_id, erroneous_form=None):
    }


@blueprint.route('/webhooks/<uuid:webhook_id>', methods=['POST'])
@blueprint.post('/webhooks/<uuid:webhook_id>')
@permission_required(WebhookPermission.administrate)
def update(webhook_id):
    """Update the webhook."""


@@ 166,7 166,7 @@ def update(webhook_id):
    return redirect_to('.index')


@blueprint.route('/webhooks/<uuid:webhook_id>/test', methods=['POST'])
@blueprint.post('/webhooks/<uuid:webhook_id>/test')
@permission_required(WebhookPermission.administrate)
@respond_no_content
def test(webhook_id):

M byceps/blueprints/api/v1/attendance/views.py => byceps/blueprints/api/v1/attendance/views.py +1 -1
@@ 23,7 23,7 @@ from .schemas import CreateArchivedAttendanceRequest
blueprint = create_blueprint('api_v1_attendance', __name__)


@blueprint.route('/archived_attendances', methods=['POST'])
@blueprint.post('/archived_attendances')
@api_token_required
@respond_no_content
def create_archived_attendance():

M byceps/blueprints/api/v1/snippet/views.py => byceps/blueprints/api/v1/snippet/views.py +1 -1
@@ 21,7 21,7 @@ from ...decorators import api_token_required
blueprint = create_blueprint('api_v1_snippet', __name__)


@blueprint.route('/by_name/<scope_type>/<scope_name>/<snippet_name>')
@blueprint.get('/by_name/<scope_type>/<scope_name>/<snippet_name>')
@api_token_required
def get_snippet_by_name(scope_type, scope_name, snippet_name):
    """Return the current version of the snippet with that name in that

M byceps/blueprints/api/v1/tourney/avatar/views.py => byceps/blueprints/api/v1/tourney/avatar/views.py +2 -2
@@ 31,7 31,7 @@ ALLOWED_IMAGE_TYPES = frozenset(
)


@blueprint.route('', methods=['POST'])
@blueprint.post('')
@api_token_required
@respond_created
def create():


@@ 75,7 75,7 @@ def _create(party_id, creator_id, image):
        abort(409, 'File already exists, not overwriting.')


@blueprint.route('/<uuid:avatar_id>', methods=['DELETE'])
@blueprint.delete('/<uuid:avatar_id>')
@api_token_required
@respond_no_content
def delete(avatar_id):

M byceps/blueprints/api/v1/tourney/match/comments/views.py => byceps/blueprints/api/v1/tourney/match/comments/views.py +6 -11
@@ 42,7 42,7 @@ from .schemas import (
blueprint = create_blueprint('api_v1_tourney_match_comments', __name__)


@blueprint.route('/match_comments/<uuid:comment_id>')
@blueprint.get('/match_comments/<uuid:comment_id>')
@api_token_required
def get_comment(comment_id):
    """Return the comment."""


@@ 53,7 53,7 @@ def get_comment(comment_id):
    return jsonify(comment_dto)


@blueprint.route('/matches/<uuid:match_id>/comments')
@blueprint.get('/matches/<uuid:match_id>/comments')
@api_token_required
def get_comments_for_match(match_id):
    """Return the comments on the match."""


@@ 120,7 120,7 @@ blueprint.add_url_rule(
)


@blueprint.route('/match_comments', methods=['POST'])
@blueprint.post('/match_comments')
@api_token_required
@respond_created
def create():


@@ 144,7 144,7 @@ def create():
    return url_for('.view', comment_id=comment.id)


@blueprint.route('/match_comments/<uuid:comment_id>', methods=['PATCH'])
@blueprint.patch('/match_comments/<uuid:comment_id>')
@api_token_required
@respond_no_content
def update(comment_id):


@@ 162,9 162,7 @@ def update(comment_id):
    comment_service.update_comment(comment.id, editor.id, body)


@blueprint.route(
    '/match_comments/<uuid:comment_id>/flags/hidden', methods=['POST']
)
@blueprint.post('/match_comments/<uuid:comment_id>/flags/hidden')
@api_token_required
@respond_no_content
def hide(comment_id):


@@ 180,10 178,7 @@ def hide(comment_id):
    comment_service.hide_comment(comment.id, initiator.id)


@blueprint.route(
    '/match_comments/<uuid:comment_id>/flags/hidden',
    methods=['DELETE'],
)
@blueprint.delete('/match_comments/<uuid:comment_id>/flags/hidden')
@api_token_required
@respond_no_content
def unhide(comment_id):

M byceps/blueprints/api/v1/user/views.py => byceps/blueprints/api/v1/user/views.py +2 -2
@@ 25,7 25,7 @@ from .schemas import InvalidateEmailAddressRequest
blueprint = create_blueprint('api_v1_user', __name__)


@blueprint.route('/<uuid:user_id>/profile')
@blueprint.get('/<uuid:user_id>/profile')
def get_profile(user_id):
    """Return (part of) user's profile as JSON."""
    user = user_service.find_active_user(user_id, include_avatar=True)


@@ 42,7 42,7 @@ def get_profile(user_id):
    )


@blueprint.route('/invalidate_email_address', methods=['POST'])
@blueprint.post('/invalidate_email_address')
@respond_no_content
def invalidate_email_address():
    """Invalidate the email address."""

M byceps/blueprints/api/v1/user_avatar/views.py => byceps/blueprints/api/v1/user_avatar/views.py +1 -1
@@ 16,7 16,7 @@ from .....util.framework.blueprint import create_blueprint
blueprint = create_blueprint('api_v1_user_avatar', __name__)


@blueprint.route('/by_email_hash/<md5_hash>')
@blueprint.get('/by_email_hash/<md5_hash>')
def get_avatar_url_by_email_address_hash(md5_hash):
    """Redirect to the avatar of the user with that hashed email address.


M byceps/blueprints/api/v1/user_badge/views.py => byceps/blueprints/api/v1/user_badge/views.py +1 -1
@@ 23,7 23,7 @@ from .schemas import AwardBadgeToUserRequest
blueprint = create_blueprint('api_v1_user_badge', __name__)


@blueprint.route('/awardings', methods=['POST'])
@blueprint.post('/awardings')
@api_token_required
@respond_no_content
def award_badge_to_user():

M byceps/blueprints/common/authentication/password/views.py => byceps/blueprints/common/authentication/password/views.py +6 -6
@@ 38,7 38,7 @@ blueprint = create_blueprint('authentication.password', __name__)
# password update


@blueprint.route('/update')
@blueprint.get('/update')
@templated
def update_form(erroneous_form=None):
    """Show a form to update the current user's password."""


@@ 49,7 49,7 @@ def update_form(erroneous_form=None):
    return {'form': form}


@blueprint.route('/', methods=['POST'])
@blueprint.post('/')
def update():
    """Update the current user's password."""
    user = _get_current_user_or_404()


@@ 75,7 75,7 @@ def update():
# password reset


@blueprint.route('/reset/request')
@blueprint.get('/reset/request')
@templated
def request_reset_form(erroneous_form=None):
    """Show a form to request a password reset."""


@@ 84,7 84,7 @@ def request_reset_form(erroneous_form=None):
    return {'form': form}


@blueprint.route('/reset/request', methods=['POST'])
@blueprint.post('/reset/request')
def request_reset():
    """Request a password reset."""
    form = RequestResetForm(request.form)


@@ 157,7 157,7 @@ def _get_sender() -> Optional[Sender]:
    return email_config.sender


@blueprint.route('/reset/token/<token>')
@blueprint.get('/reset/token/<token>')
@templated
def reset_form(token, erroneous_form=None):
    """Show a form to reset the current user's password."""


@@ 171,7 171,7 @@ def reset_form(token, erroneous_form=None):
    }


@blueprint.route('/reset/token/<token>', methods=['POST'])
@blueprint.post('/reset/token/<token>')
def reset(token):
    """Reset the current user's password."""
    verification_token = _verify_reset_token(token)

M byceps/blueprints/common/locale/views.py => byceps/blueprints/common/locale/views.py +1 -1
@@ 15,7 15,7 @@ from ....util import user_session
blueprint = create_blueprint('locale', __name__)


@blueprint.route('/set')
@blueprint.get('/set')
def set_locale():
    """Set the locale."""
    locale = request.args.get('locale')

M byceps/blueprints/common/style_guide/views.py => byceps/blueprints/common/style_guide/views.py +1 -1
@@ 20,7 20,7 @@ blueprint = create_blueprint('style_guide', __name__)
ICONS_FILENAME = 'static/style/icons.svg'


@blueprint.route('/')
@blueprint.get('/')
@templated
def index():
    """Show style guide."""

M byceps/blueprints/monitoring/healthcheck/views.py => byceps/blueprints/monitoring/healthcheck/views.py +1 -1
@@ 18,7 18,7 @@ from ....util.framework.blueprint import create_blueprint
blueprint = create_blueprint('healthcheck', __name__)


@blueprint.route('')
@blueprint.get('')
def health():
    """Return health status as JSON.


M byceps/blueprints/monitoring/metrics/views.py => byceps/blueprints/monitoring/metrics/views.py +1 -1
@@ 17,7 17,7 @@ from ....util.framework.blueprint import create_blueprint
blueprint = create_blueprint('metrics', __name__)


@blueprint.route('')
@blueprint.get('')
def metrics():
    """Return metrics."""
    metrics = metrics_service.collect_metrics()

M byceps/blueprints/site/attendance/views.py => byceps/blueprints/site/attendance/views.py +2 -2
@@ 16,8 16,8 @@ from ....util.framework.templating import templated
blueprint = create_blueprint('attendance', __name__)


@blueprint.route('/attendees', defaults={'page': 1})
@blueprint.route('/attendees/pages/<int:page>')
@blueprint.get('/attendees', defaults={'page': 1})
@blueprint.get('/attendees/pages/<int:page>')
@templated
def attendees(page):
    """List all attendees of the current party."""

M byceps/blueprints/site/authentication/login/views.py => byceps/blueprints/site/authentication/login/views.py +3 -3
@@ 39,7 39,7 @@ blueprint = create_blueprint('authentication.login', __name__)
# log in/out


@blueprint.route('/login')
@blueprint.get('/login')
@templated
def login_form():
    """Show login form."""


@@ 68,7 68,7 @@ def login_form():
    }


@blueprint.route('/login', methods=['POST'])
@blueprint.post('/login')
@respond_no_content
def login():
    """Allow the user to authenticate with e-mail address and password."""


@@ 131,7 131,7 @@ def _is_consent_required(user_id: UserID) -> bool:
    )


@blueprint.route('/logout', methods=['POST'])
@blueprint.post('/logout')
@respond_no_content
def logout():
    """Log out user by deleting the corresponding cookie."""

M byceps/blueprints/site/board/views_category.py => byceps/blueprints/site/board/views_category.py +4 -6
@@ 22,7 22,7 @@ from .blueprint import blueprint
from . import _helpers as h, service


@blueprint.route('/')
@blueprint.get('/')
@templated
def category_index():
    """List categories."""


@@ 44,8 44,8 @@ def category_index():
    }


@blueprint.route('/categories/<slug>', defaults={'page': 1})
@blueprint.route('/categories/<slug>/pages/<int:page>')
@blueprint.get('/categories/<slug>', defaults={'page': 1})
@blueprint.get('/categories/<slug>/pages/<int:page>')
@templated
def category_view(slug, page):
    """List latest topics in the category."""


@@ 85,9 85,7 @@ def category_view(slug, page):
    }


@blueprint.route(
    '/categories/<category_id>/mark_all_topics_as_read', methods=['POST']
)
@blueprint.post('/categories/<category_id>/mark_all_topics_as_read')
@respond_no_content_with_location
def mark_all_topics_in_category_as_viewed(category_id):
    category = h.get_category_or_404(category_id)

M byceps/blueprints/site/board/views_posting.py => byceps/blueprints/site/board/views_posting.py +8 -8
@@ 30,7 30,7 @@ from .forms import PostingCreateForm, PostingUpdateForm
from . import _helpers as h, service


@blueprint.route('/postings/<uuid:posting_id>')
@blueprint.get('/postings/<uuid:posting_id>')
def posting_view(posting_id):
    """Show the page of the posting's topic that contains the posting,
    as seen by the current user.


@@ 44,7 44,7 @@ def posting_view(posting_id):
    )


@blueprint.route('/topics/<uuid:topic_id>/create')
@blueprint.get('/topics/<uuid:topic_id>/create')
@permission_required(BoardPostingPermission.create)
@templated
def posting_create_form(topic_id, erroneous_form=None):


@@ 79,7 79,7 @@ def quote_posting_as_bbcode():
    return f'[quote author="{creator.screen_name}"]{posting.body}[/quote]'


@blueprint.route('/topics/<uuid:topic_id>/create', methods=['POST'])
@blueprint.post('/topics/<uuid:topic_id>/create')
@permission_required(BoardPostingPermission.create)
def posting_create(topic_id):
    """Create a posting to the topic."""


@@ 130,7 130,7 @@ def posting_create(topic_id):
    return redirect(h.build_url_for_posting_in_topic_view(posting, page_count))


@blueprint.route('/postings/<uuid:posting_id>/update')
@blueprint.get('/postings/<uuid:posting_id>/update')
@permission_required(BoardPostingPermission.update)
@templated
def posting_update_form(posting_id, erroneous_form=None):


@@ 168,7 168,7 @@ def posting_update_form(posting_id, erroneous_form=None):
    }


@blueprint.route('/postings/<uuid:posting_id>', methods=['POST'])
@blueprint.post('/postings/<uuid:posting_id>')
@permission_required(BoardPostingPermission.update)
def posting_update(posting_id):
    """Update a posting."""


@@ 214,7 214,7 @@ def posting_update(posting_id):
    return redirect(url)


@blueprint.route('/postings/<uuid:posting_id>/moderate')
@blueprint.get('/postings/<uuid:posting_id>/moderate')
@permission_required(BoardPermission.hide)
@templated
def posting_moderate_form(posting_id):


@@ 228,7 228,7 @@ def posting_moderate_form(posting_id):
    }


@blueprint.route('/postings/<uuid:posting_id>/flags/hidden', methods=['POST'])
@blueprint.post('/postings/<uuid:posting_id>/flags/hidden')
@permission_required(BoardPermission.hide)
@respond_no_content_with_location
def posting_hide(posting_id):


@@ 250,7 250,7 @@ def posting_hide(posting_id):
    return h.build_url_for_posting_in_topic_view(posting, page)


@blueprint.route('/postings/<uuid:posting_id>/flags/hidden', methods=['DELETE'])
@blueprint.delete('/postings/<uuid:posting_id>/flags/hidden')
@permission_required(BoardPermission.hide)
@respond_no_content_with_location
def posting_unhide(posting_id):

M byceps/blueprints/site/board/views_topic.py => byceps/blueprints/site/board/views_topic.py +18 -22
@@ 35,8 35,8 @@ from .forms import PostingCreateForm, TopicCreateForm, TopicUpdateForm
from . import _helpers as h, service


@blueprint.route('/topics', defaults={'page': 1})
@blueprint.route('/topics/pages/<int:page>')
@blueprint.get('/topics', defaults={'page': 1})
@blueprint.get('/topics/pages/<int:page>')
@templated
def topic_index(page):
    """List latest topics in all categories."""


@@ 60,8 60,8 @@ def topic_index(page):
    }


@blueprint.route('/topics/<uuid:topic_id>', defaults={'page': 0})
@blueprint.route('/topics/<uuid:topic_id>/pages/<int:page>')
@blueprint.get('/topics/<uuid:topic_id>', defaults={'page': 0})
@blueprint.get('/topics/<uuid:topic_id>/pages/<int:page>')
@templated
def topic_view(topic_id, page):
    """List postings for the topic."""


@@ 163,7 163,7 @@ def _find_posting_url_to_redirect_to(
    return h.build_url_for_posting_in_topic_view(posting, page)


@blueprint.route('/categories/<category_id>/create')
@blueprint.get('/categories/<category_id>/create')
@permission_required(BoardTopicPermission.create)
@templated
def topic_create_form(category_id, erroneous_form=None):


@@ 179,7 179,7 @@ def topic_create_form(category_id, erroneous_form=None):
    }


@blueprint.route('/categories/<category_id>/create', methods=['POST'])
@blueprint.post('/categories/<category_id>/create')
@permission_required(BoardTopicPermission.create)
def topic_create(category_id):
    """Create a topic in the category."""


@@ 208,7 208,7 @@ def topic_create(category_id):
    return redirect(topic_url)


@blueprint.route('/topics/<uuid:topic_id>/update')
@blueprint.get('/topics/<uuid:topic_id>/update')
@permission_required(BoardTopicPermission.update)
@templated
def topic_update_form(topic_id, erroneous_form=None):


@@ 245,7 245,7 @@ def topic_update_form(topic_id, erroneous_form=None):
    }


@blueprint.route('/topics/<uuid:topic_id>', methods=['POST'])
@blueprint.post('/topics/<uuid:topic_id>')
@permission_required(BoardTopicPermission.update)
def topic_update(topic_id):
    """Update a topic."""


@@ 282,7 282,7 @@ def topic_update(topic_id):
    return redirect(url)


@blueprint.route('/topics/<uuid:topic_id>/moderate')
@blueprint.get('/topics/<uuid:topic_id>/moderate')
@permission_required(BoardPermission.hide)
@templated
def topic_moderate_form(topic_id):


@@ 302,7 302,7 @@ def topic_moderate_form(topic_id):
    }


@blueprint.route('/topics/<uuid:topic_id>/flags/hidden', methods=['POST'])
@blueprint.post('/topics/<uuid:topic_id>/flags/hidden')
@permission_required(BoardPermission.hide)
@respond_no_content_with_location
def topic_hide(topic_id):


@@ 325,7 325,7 @@ def topic_hide(topic_id):
    return h.build_url_for_topic_in_category_view(topic)


@blueprint.route('/topics/<uuid:topic_id>/flags/hidden', methods=['DELETE'])
@blueprint.delete('/topics/<uuid:topic_id>/flags/hidden')
@permission_required(BoardPermission.hide)
@respond_no_content_with_location
def topic_unhide(topic_id):


@@ 351,7 351,7 @@ def topic_unhide(topic_id):
    return h.build_url_for_topic_in_category_view(topic)


@blueprint.route('/topics/<uuid:topic_id>/flags/locked', methods=['POST'])
@blueprint.post('/topics/<uuid:topic_id>/flags/locked')
@permission_required(BoardTopicPermission.lock)
@respond_no_content_with_location
def topic_lock(topic_id):


@@ 374,7 374,7 @@ def topic_lock(topic_id):
    return h.build_url_for_topic_in_category_view(topic)


@blueprint.route('/topics/<uuid:topic_id>/flags/locked', methods=['DELETE'])
@blueprint.delete('/topics/<uuid:topic_id>/flags/locked')
@permission_required(BoardTopicPermission.lock)
@respond_no_content_with_location
def topic_unlock(topic_id):


@@ 397,7 397,7 @@ def topic_unlock(topic_id):
    return h.build_url_for_topic_in_category_view(topic)


@blueprint.route('/topics/<uuid:topic_id>/flags/pinned', methods=['POST'])
@blueprint.post('/topics/<uuid:topic_id>/flags/pinned')
@permission_required(BoardTopicPermission.pin)
@respond_no_content_with_location
def topic_pin(topic_id):


@@ 420,7 420,7 @@ def topic_pin(topic_id):
    return h.build_url_for_topic_in_category_view(topic)


@blueprint.route('/topics/<uuid:topic_id>/flags/pinned', methods=['DELETE'])
@blueprint.delete('/topics/<uuid:topic_id>/flags/pinned')
@permission_required(BoardTopicPermission.pin)
@respond_no_content_with_location
def topic_unpin(topic_id):


@@ 442,7 442,7 @@ def topic_unpin(topic_id):
    return h.build_url_for_topic_in_category_view(topic)


@blueprint.route('/topics/<uuid:topic_id>/move', methods=['POST'])
@blueprint.post('/topics/<uuid:topic_id>/move')
@permission_required(BoardTopicPermission.move)
def topic_move(topic_id):
    """Move a topic from one category to another."""


@@ 480,9 480,7 @@ def topic_move(topic_id):
    return redirect(h.build_url_for_topic_in_category_view(topic))


@blueprint.route(
    '/topics/<uuid:topic_id>/flags/announcements', methods=['POST']
)
@blueprint.post('/topics/<uuid:topic_id>/flags/announcements')
@permission_required(BoardPermission.announce)
@respond_no_content_with_location
def topic_limit_to_announcements(topic_id):


@@ 502,9 500,7 @@ def topic_limit_to_announcements(topic_id):
    return h.build_url_for_topic_in_category_view(topic)


@blueprint.route(
    '/topics/<uuid:topic_id>/flags/announcements', methods=['DELETE']
)
@blueprint.delete('/topics/<uuid:topic_id>/flags/announcements')
@permission_required(BoardPermission.announce)
@respond_no_content_with_location
def topic_remove_limit_to_announcements(topic_id):

M byceps/blueprints/site/consent/views.py => byceps/blueprints/site/consent/views.py +2 -2
@@ 27,7 27,7 @@ from .forms import create_consent_form, get_subject_field_name
blueprint = create_blueprint('consent', __name__)


@blueprint.route('/consent/<token>')
@blueprint.get('/consent/<token>')
@templated
def consent_form(token, *, erroneous_form=None):
    """Show form requiring consent to required subjects to which the


@@ 57,7 57,7 @@ def _get_subjects_and_fields(subjects, form):
    return list(zip(subjects, fields))


@blueprint.route('/consent/<token>', methods=['POST'])
@blueprint.post('/consent/<token>')
def consent(token):
    """Consent to the specified subjects."""
    verification_token = _get_verification_token_or_404(token)

M byceps/blueprints/site/dashboard/views.py => byceps/blueprints/site/dashboard/views.py +1 -1
@@ 39,7 39,7 @@ from ..board import service as board_helper_service
blueprint = create_blueprint('dashboard', __name__)


@blueprint.route('')
@blueprint.get('')
@login_required
@templated
def index():

M byceps/blueprints/site/news/views.py => byceps/blueprints/site/news/views.py +3 -3
@@ 29,8 29,8 @@ register_permission_enum(NewsItemPermission)
DEFAULT_ITEMS_PER_PAGE = 4


@blueprint.route('/', defaults={'page': 1})
@blueprint.route('/pages/<int:page>')
@blueprint.get('/', defaults={'page': 1})
@blueprint.get('/pages/<int:page>')
@templated
def index(page):
    """Show a page of news items."""


@@ 48,7 48,7 @@ def index(page):
    }


@blueprint.route('/<slug>')
@blueprint.get('/<slug>')
@templated
def view(slug):
    """Show a single news item."""

M byceps/blueprints/site/newsletter/views.py => byceps/blueprints/site/newsletter/views.py +2 -2
@@ 20,7 20,7 @@ from ....util.views import login_required, respond_no_content
blueprint = create_blueprint('newsletter', __name__)


@blueprint.route('/lists/<list_id>/subscription', methods=['POST'])
@blueprint.post('/lists/<list_id>/subscription')
@login_required
@respond_no_content
def subscribe(list_id):


@@ 37,7 37,7 @@ def subscribe(list_id):
    )


@blueprint.route('/lists/<list_id>/subscription', methods=['DELETE'])
@blueprint.delete('/lists/<list_id>/subscription')
@login_required
@respond_no_content
def unsubscribe(list_id):

M byceps/blueprints/site/orga_team/views.py => byceps/blueprints/site/orga_team/views.py +1 -1
@@ 17,7 17,7 @@ from ....util.framework.templating import templated
blueprint = create_blueprint('orga_team', __name__)


@blueprint.route('/')
@blueprint.get('/')
@templated
def index():
    """List all organizers for the current party."""

M byceps/blueprints/site/party/views.py => byceps/blueprints/site/party/views.py +2 -2
@@ 17,7 17,7 @@ from ....util.framework.templating import templated
blueprint = create_blueprint('party', __name__)


@blueprint.route('/info')
@blueprint.get('/info')
@templated
def info():
    """Show information about the current party."""


@@ 32,7 32,7 @@ def info():
    }


@blueprint.route('/archive')
@blueprint.get('/archive')
@templated
def archive():
    """Show archived parties."""

M byceps/blueprints/site/seating/views.py => byceps/blueprints/site/seating/views.py +5 -7
@@ 38,7 38,7 @@ blueprint = create_blueprint('seating', __name__)
register_permission_enum(SeatingPermission)


@blueprint.route('/')
@blueprint.get('/')
@templated
def index():
    """List areas."""


@@ 53,7 53,7 @@ def index():
    }


@blueprint.route('/areas/<slug>')
@blueprint.get('/areas/<slug>')
@templated
def view_area(slug):
    """View area."""


@@ 81,7 81,7 @@ def view_area(slug):
    }


@blueprint.route('/areas/<slug>/manage_seats')
@blueprint.get('/areas/<slug>/manage_seats')
@login_required
@templated('site/seating/view_area')
def manage_seats_in_area(slug):


@@ 169,9 169,7 @@ def _get_selected_ticket():
    return selected_ticket


@blueprint.route(
    '/ticket/<uuid:ticket_id>/seat/<uuid:seat_id>', methods=['POST']
)
@blueprint.post('/ticket/<uuid:ticket_id>/seat/<uuid:seat_id>')
@login_required
@respond_no_content
def occupy_seat(ticket_id, seat_id):


@@ 241,7 239,7 @@ def occupy_seat(ticket_id, seat_id):
    )


@blueprint.route('/ticket/<uuid:ticket_id>/seat', methods=['DELETE'])
@blueprint.delete('/ticket/<uuid:ticket_id>/seat')
@login_required
@respond_no_content
def release_seat(ticket_id):

M byceps/blueprints/site/shop/order/views.py => byceps/blueprints/site/shop/order/views.py +4 -4
@@ 41,7 41,7 @@ def tax_rate_as_percentage(tax_rate) -> str:
    return str(percentage).replace('.', ',')


@blueprint.route('/order')
@blueprint.get('/order')
@templated
def order_form(erroneous_form=None):
    """Show a form to order articles."""


@@ 89,7 89,7 @@ def list_articles(article_compilation):
    }


@blueprint.route('/order', methods=['POST'])
@blueprint.post('/order')
@login_required
def order():
    """Order articles."""


@@ 133,7 133,7 @@ def order():
    return redirect_to('shop_orders.view', order_id=order.id)


@blueprint.route('/order_single/<uuid:article_id>')
@blueprint.get('/order_single/<uuid:article_id>')
@login_required
@templated
def order_single_form(article_id, erroneous_form=None):


@@ 193,7 193,7 @@ def order_single_form(article_id, erroneous_form=None):
    }


@blueprint.route('/order_single/<uuid:article_id>', methods=['POST'])
@blueprint.post('/order_single/<uuid:article_id>')
@login_required
def order_single(article_id):
    """Order a single article."""

M byceps/blueprints/site/shop/orders/views.py => byceps/blueprints/site/shop/orders/views.py +4 -4
@@ 29,7 29,7 @@ from .forms import CancelForm
blueprint = create_blueprint('shop_orders', __name__)


@blueprint.route('')
@blueprint.get('')
@login_required
@templated
def index():


@@ 53,7 53,7 @@ def index():
    }


@blueprint.route('/<uuid:order_id>')
@blueprint.get('/<uuid:order_id>')
@login_required
@templated
def view(order_id):


@@ 100,7 100,7 @@ def _get_payment_instructions(order):
    )


@blueprint.route('/<uuid:order_id>/cancel')
@blueprint.get('/<uuid:order_id>/cancel')
@login_required
@templated
def cancel_form(order_id, erroneous_form=None):


@@ 127,7 127,7 @@ def cancel_form(order_id, erroneous_form=None):
    }


@blueprint.route('/<uuid:order_id>/cancel', methods=['POST'])
@blueprint.post('/<uuid:order_id>/cancel')
@login_required
def cancel(order_id):
    """Set the payment status of a single order to 'canceled' and

M byceps/blueprints/site/snippet/views.py => byceps/blueprints/site/snippet/views.py +1 -1
@@ 24,7 24,7 @@ blueprint.add_app_template_global(render_snippet_as_partial, 'render_snippet')
blueprint.add_app_template_global(url_for_snippet)


@blueprint.route('/<path:url_path>')
@blueprint.get('/<path:url_path>')
def view(url_path):
    """Show the current version of the snippet that is mounted for the
    current site at the given URL path.

M byceps/blueprints/site/terms/views.py => byceps/blueprints/site/terms/views.py +1 -1
@@ 16,7 16,7 @@ from ....util.framework.templating import templated
blueprint = create_blueprint('terms', __name__)


@blueprint.route('/')
@blueprint.get('/')
@templated
def view_current():
    """Show the current version of this brand's terms and conditions."""

M byceps/blueprints/site/ticketing/views.py => byceps/blueprints/site/ticketing/views.py +11 -11
@@ 30,7 30,7 @@ from . import notification_service
blueprint = create_blueprint('ticketing', __name__)


@blueprint.route('/mine')
@blueprint.get('/mine')
@login_required
@templated
def index_mine():


@@ 62,7 62,7 @@ def index_mine():
    }


@blueprint.route('/tickets/<uuid:ticket_id>/printable.html')
@blueprint.get('/tickets/<uuid:ticket_id>/printable.html')
@login_required
@templated
def view_printable_html(ticket_id):


@@ 104,7 104,7 @@ def view_printable_html(ticket_id):
# user


@blueprint.route('/tickets/<uuid:ticket_id>/appoint_user')
@blueprint.get('/tickets/<uuid:ticket_id>/appoint_user')
@login_required
@templated
def appoint_user_form(ticket_id, erroneous_form=None):


@@ 128,7 128,7 @@ def appoint_user_form(ticket_id, erroneous_form=None):
    }


@blueprint.route('/tickets/<uuid:ticket_id>/user', methods=['POST'])
@blueprint.post('/tickets/<uuid:ticket_id>/user')
def appoint_user(ticket_id):
    """Appoint a user for the ticket."""
    _abort_if_ticket_management_disabled()


@@ 163,7 163,7 @@ def appoint_user(ticket_id):
    return redirect_to('.index_mine')


@blueprint.route('/tickets/<uuid:ticket_id>/user', methods=['DELETE'])
@blueprint.delete('/tickets/<uuid:ticket_id>/user')
@respond_no_content
def withdraw_user(ticket_id):
    """Withdraw the ticket's user and appoint its owner instead."""


@@ 194,7 194,7 @@ def withdraw_user(ticket_id):
# user manager


@blueprint.route('/tickets/<uuid:ticket_id>/appoint_user_manager')
@blueprint.get('/tickets/<uuid:ticket_id>/appoint_user_manager')
@login_required
@templated
def appoint_user_manager_form(ticket_id, erroneous_form=None):


@@ 218,7 218,7 @@ def appoint_user_manager_form(ticket_id, erroneous_form=None):
    }


@blueprint.route('/tickets/<uuid:ticket_id>/user_manager', methods=['POST'])
@blueprint.post('/tickets/<uuid:ticket_id>/user_manager')
def appoint_user_manager(ticket_id):
    """Appoint a user manager for the ticket."""
    _abort_if_ticket_management_disabled()


@@ 256,7 256,7 @@ def appoint_user_manager(ticket_id):
    return redirect_to('.index_mine')


@blueprint.route('/tickets/<uuid:ticket_id>/user_manager', methods=['DELETE'])
@blueprint.delete('/tickets/<uuid:ticket_id>/user_manager')
@respond_no_content
def withdraw_user_manager(ticket_id):
    """Withdraw the ticket's user manager."""


@@ 289,7 289,7 @@ def withdraw_user_manager(ticket_id):
# seat manager


@blueprint.route('/tickets/<uuid:ticket_id>/appoint_seat_manager')
@blueprint.get('/tickets/<uuid:ticket_id>/appoint_seat_manager')
@login_required
@templated
def appoint_seat_manager_form(ticket_id, erroneous_form=None):


@@ 311,7 311,7 @@ def appoint_seat_manager_form(ticket_id, erroneous_form=None):
    }


@blueprint.route('/tickets/<uuid:ticket_id>/seat_manager', methods=['POST'])
@blueprint.post('/tickets/<uuid:ticket_id>/seat_manager')
def appoint_seat_manager(ticket_id):
    """Appoint a seat manager for the ticket."""
    _abort_if_ticket_management_disabled()


@@ 347,7 347,7 @@ def appoint_seat_manager(ticket_id):
    return redirect_to('.index_mine')


@blueprint.route('/tickets/<uuid:ticket_id>/seat_manager', methods=['DELETE'])
@blueprint.delete('/tickets/<uuid:ticket_id>/seat_manager')
@respond_no_content
def withdraw_seat_manager(ticket_id):
    """Withdraw the ticket's seat manager."""

M byceps/blueprints/site/tourney/views.py => byceps/blueprints/site/tourney/views.py +2 -2
@@ 24,7 24,7 @@ from ....util.framework.templating import templated
blueprint = create_blueprint('tourney', __name__)


@blueprint.route('/tourneys')
@blueprint.get('/tourneys')
@templated
def tourney_index():
    """List all tournaments for the current party."""


@@ 65,7 65,7 @@ def get_categories_with_tourneys(categories, tourneys):
    return categories_with_tourneys


@blueprint.route('/tourneys/<tourney_id>')
@blueprint.get('/tourneys/<tourney_id>')
@templated
def tourney_view(tourney_id):
    """Show the tournament."""

M byceps/blueprints/site/user/avatar/views.py => byceps/blueprints/site/user/avatar/views.py +3 -3
@@ 33,7 33,7 @@ ALLOWED_IMAGE_TYPES = frozenset(
)


@blueprint.route('/me/avatar/update')
@blueprint.get('/me/avatar/update')
@templated
def update_form(erroneous_form=None):
    """Show a form to update the current user's avatar image."""


@@ 50,7 50,7 @@ def update_form(erroneous_form=None):
    }


@blueprint.route('/me/avatar', methods=['POST'])
@blueprint.post('/me/avatar')
def update():
    """Update the current user's avatar image."""
    user = _get_current_user_or_404()


@@ 91,7 91,7 @@ def _update(user_id, image):
        abort(409, 'File already exists, not overwriting.')


@blueprint.route('/me/avatar', methods=['DELETE'])
@blueprint.delete('/me/avatar')
@respond_no_content
def delete():
    """Remove the current user's avatar image."""

M byceps/blueprints/site/user/creation/views.py => byceps/blueprints/site/user/creation/views.py +2 -2
@@ 37,7 37,7 @@ from .forms import assemble_user_create_form
blueprint = create_blueprint('user_creation', __name__)


@blueprint.route('/create')
@blueprint.get('/create')
@templated
def create_form(erroneous_form=None):
    """Show a form to create a user."""


@@ 65,7 65,7 @@ def create_form(erroneous_form=None):
    }


@blueprint.route('/', methods=['POST'])
@blueprint.post('/')
def create():
    """Create a user."""
    _abort_if_user_account_creation_disabled()

M byceps/blueprints/site/user/current/views.py => byceps/blueprints/site/user/current/views.py +1 -1
@@ 14,7 14,7 @@ from .....util.framework.blueprint import create_blueprint
blueprint = create_blueprint('user_current', __name__)


@blueprint.route('/me.json')
@blueprint.get('/me.json')
def view_as_json():
    """Show selected attributes of the current user's profile as JSON."""
    user = g.user

M byceps/blueprints/site/user/email_address/views.py => byceps/blueprints/site/user/email_address/views.py +3 -3
@@ 29,7 29,7 @@ from .forms import RequestConfirmationEmailForm
blueprint = create_blueprint('user_email_address', __name__)


@blueprint.route('/confirmation_email/request')
@blueprint.get('/confirmation_email/request')
@templated
def request_confirmation_email_form(erroneous_form=None):
    """Show a form to request the email address confirmation email for the user


@@ 39,7 39,7 @@ def request_confirmation_email_form(erroneous_form=None):
    return {'form': form}


@blueprint.route('/confirmation_email/request', methods=['POST'])
@blueprint.post('/confirmation_email/request')
def request_confirmation_email():
    """Request the email address confirmation email for the user account
    again.


@@ 104,7 104,7 @@ def request_confirmation_email():
    return redirect_to('.request_confirmation_email_form')


@blueprint.route('/confirmation/<token>')
@blueprint.get('/confirmation/<token>')
def confirm(token):
    """Confirm e-mail address of the user account assigned with the
    verification token.

M byceps/blueprints/site/user/settings/views.py => byceps/blueprints/site/user/settings/views.py +5 -5
@@ 29,7 29,7 @@ from .forms import DetailsForm, ChangeScreenNameForm
blueprint = create_blueprint('user_settings', __name__)


@blueprint.route('')
@blueprint.get('')
@login_required
@templated
def view():


@@ 53,7 53,7 @@ def view():
    }


@blueprint.route('/screen_name')
@blueprint.get('/screen_name')
@login_required
@templated
def change_screen_name_form(erroneous_form=None):


@@ 66,7 66,7 @@ def change_screen_name_form(erroneous_form=None):


@login_required
@blueprint.route('/screen_name', methods=['POST'])
@blueprint.post('/screen_name')
def change_screen_name():
    """Change the current user's screen name."""
    current_user = g.user


@@ 95,7 95,7 @@ def change_screen_name():
    return redirect_to('.view')


@blueprint.route('/details')
@blueprint.get('/details')
@login_required
@templated
def details_update_form(erroneous_form=None):


@@ 111,7 111,7 @@ def details_update_form(erroneous_form=None):
    }


@blueprint.route('/details', methods=['POST'])
@blueprint.post('/details')
@login_required
def details_update():
    """Update the current user's details."""

M byceps/blueprints/site/user_badge/views.py => byceps/blueprints/site/user_badge/views.py +2 -2
@@ 17,7 17,7 @@ from ....util.framework.templating import templated
blueprint = create_blueprint('user_badge', __name__)


@blueprint.route('/')
@blueprint.get('/')
@templated
def index():
    """List all badges."""


@@ 28,7 28,7 @@ def index():
    }


@blueprint.route('/<slug>')
@blueprint.get('/<slug>')
@templated
def view(slug):
    """Show information about a badge."""

M byceps/blueprints/site/user_group/views.py => byceps/blueprints/site/user_group/views.py +3 -3
@@ 21,7 21,7 @@ from .forms import CreateForm
blueprint = create_blueprint('user_group', __name__)


@blueprint.route('/')
@blueprint.get('/')
@templated
def index():
    """List groups."""


@@ 32,7 32,7 @@ def index():
    }


@blueprint.route('/create')
@blueprint.get('/create')
@templated
def create_form(erroneous_form=None):
    """Show a form to create a group."""


@@ 47,7 47,7 @@ def create_form(erroneous_form=None):
    }


@blueprint.route('/', methods=['POST'])
@blueprint.post('/')
def create():
    """Create a group."""
    if not g.user.authenticated:

M byceps/blueprints/site/user_message/views.py => byceps/blueprints/site/user_message/views.py +2 -2
@@ 24,7 24,7 @@ from .forms import CreateForm
blueprint = create_blueprint('user_message', __name__)


@blueprint.route('/to/<uuid:recipient_id>/create')
@blueprint.get('/to/<uuid:recipient_id>/create')
@login_required
@templated
def create_form(recipient_id, erroneous_form=None):


@@ 39,7 39,7 @@ def create_form(recipient_id, erroneous_form=None):
    }


@blueprint.route('/to/<uuid:recipient_id>/create', methods=['POST'])
@blueprint.post('/to/<uuid:recipient_id>/create')
@login_required
def create(recipient_id):
    """Create a message to send to the user."""

M byceps/blueprints/site/user_profile/views.py => byceps/blueprints/site/user_profile/views.py +1 -1
@@ 21,7 21,7 @@ from ....util.framework.templating import templated
blueprint = create_blueprint('user_profile', __name__)


@blueprint.route('/<uuid:user_id>')
@blueprint.get('/<uuid:user_id>')
@templated
def view(user_id):
    """Show a user's profile."""