Skip to content

chore: prefix all routes with account #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions accounts/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def create_app(config_type):
config_errorhandler(app)

# add view for changing theme
@app.get("/change-theme")
@app.get("/account/change-theme")
def change_theme():
theme = request.args.get("theme", app.config["BOOTSTRAP_DEFAULT_THEME"])

Expand All @@ -51,7 +51,7 @@ def change_theme():
app.config["BOOTSTRAP_BOOTSWATCH_THEME"] = theme
return redirect(url_for("accounts.index"))

@app.get("/change-lang")
@app.get("/account/change-lang")
def change_lang():
lang = request.args.get("lang", app.config["BABEL_DEFAULT_LOCALE"])

Expand Down
18 changes: 9 additions & 9 deletions accounts/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
accounts = Blueprint("accounts", __name__, template_folder="templates")


@accounts.route("/login_as_guest", methods=["GET", "POST"])
@accounts.route("/account/login_as_guest", methods=["GET", "POST"])
@authentication_redirect
@limiter.limit("3/min", methods=["POST"])
def login_guest_user() -> Response:
Expand Down Expand Up @@ -71,7 +71,7 @@ def login_guest_user() -> Response:
return abort(HTTPStatus.NOT_FOUND)


@accounts.route("/register", methods=["GET", "POST"])
@accounts.route("/account/register", methods=["GET", "POST"])
@authentication_redirect
@limiter.limit("3/min", methods=["POST"])
def register() -> Response:
Expand Down Expand Up @@ -116,7 +116,7 @@ def register() -> Response:
return render_template("register.html", form=form)


@accounts.route("/login", methods=["GET", "POST"])
@accounts.route("/account/login", methods=["GET", "POST"])
@authentication_redirect
@limiter.limit("5/minute", methods=["POST"])
def login() -> Response:
Expand Down Expand Up @@ -215,7 +215,7 @@ def confirm_account() -> Response:
return abort(HTTPStatus.NOT_FOUND)


@accounts.route("/logout", methods=["GET", "POST"])
@accounts.route("/account/logout", methods=["GET", "POST"])
@login_required
def logout() -> Response:
"""
Expand All @@ -231,7 +231,7 @@ def logout() -> Response:
return redirect(url_for("accounts.login"))


@accounts.route("/forgot/password", methods=["GET", "POST"])
@accounts.route("/account/forgot/password", methods=["GET", "POST"])
@guest_user_exempt
@limiter.limit("3/minute", methods=["POST"])
def forgot_password() -> Response:
Expand Down Expand Up @@ -269,7 +269,7 @@ def forgot_password() -> Response:
return render_template("forgot_password.html", form=form)


@accounts.route("/password/reset", methods=["GET", "POST"])
@accounts.route("/account/password/reset", methods=["GET", "POST"])
@limiter.limit("5/min", methods=["POST"])
def reset_password() -> Response:
"""
Expand Down Expand Up @@ -344,7 +344,7 @@ def reset_password() -> Response:
return abort(HTTPStatus.NOT_FOUND)


@accounts.route("/change/password", methods=["GET", "POST"])
@accounts.route("/account/change/password", methods=["GET", "POST"])
@login_required
@guest_user_exempt
@limiter.limit("5/min", methods=["POST"])
Expand Down Expand Up @@ -406,7 +406,7 @@ def change_password() -> Response:
return render_template("change_password.html", form=form)


@accounts.route("/change/email", methods=["GET", "POST"])
@accounts.route("/account/change/email", methods=["GET", "POST"])
@login_required
@guest_user_exempt
@limiter.limit("5/min", methods=["POST"])
Expand Down Expand Up @@ -518,7 +518,7 @@ def index() -> Response:
return render_template("index.html")


@accounts.route("/profile", methods=["GET", "POST"])
@accounts.route("/account/profile", methods=["GET", "POST"])
@login_required
@guest_user_exempt
@limiter.limit("8/min", methods=["POST"])
Expand Down