API: Fix Flask 2.0.x incompatible blueprint names

This commit is contained in:
Drew DeVault 2021-05-26 10:05:23 -04:00
parent 95d7c18b13
commit dedc26ad97
3 changed files with 3 additions and 3 deletions

View File

@ -3,7 +3,7 @@ import tarfile
from flask import Blueprint, abort, send_file
from srht.oauth import oauth
internal = Blueprint("api.internal", __name__)
internal = Blueprint("api_internal", __name__)
@internal.route("/api/_internal/data-export")
@oauth(None, require_internal=True)

View File

@ -13,7 +13,7 @@ from todosrht.types import Event, EventType, Label, TicketLabel, TicketComment
from todosrht.types import TicketAuthenticity, ParticipantType
from todosrht.webhooks import TrackerWebhook, TicketWebhook
tickets = Blueprint("api.tickets", __name__)
tickets = Blueprint("api_tickets", __name__)
@tickets.route("/api/user/<username>/trackers/<tracker_name>/tickets")
@tickets.route("/api/trackers/<tracker_name>/tickets",

View File

@ -9,7 +9,7 @@ from todosrht.tickets import get_participant_for_user
from todosrht.types import Label, Tracker, TicketAccess, TicketSubscription
from todosrht.webhooks import UserWebhook, TrackerWebhook
trackers = Blueprint("api.trackers", __name__)
trackers = Blueprint("api_trackers", __name__)
@trackers.route("/api/user/<username>/trackers")
@trackers.route("/api/trackers", defaults={"username": None})