From fcc3ce60bcfa57734a51723717fe681ee4bf1327 Mon Sep 17 00:00:00 2001 From: Frederick Yin Date: Sat, 5 Feb 2022 16:39:41 +0800 Subject: Config format switched to .ini Eliminated toml from dependency list --- jimbrella/auth.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'jimbrella/auth.py') diff --git a/jimbrella/auth.py b/jimbrella/auth.py index 39d355b..0b88de2 100644 --- a/jimbrella/auth.py +++ b/jimbrella/auth.py @@ -2,10 +2,10 @@ from flask import Blueprint, request, session, render_template, redirect, url_fo from werkzeug.security import generate_password_hash, check_password_hash from .users import Users from .exceptions import UsernameTakenError -from .config import * +from .config import config bp = Blueprint("auth", __name__, url_prefix="/") -users = Users(DATABASE_PATH) +users = Users(config.get("general", "db_path")) def show_error(action, message): @@ -39,7 +39,7 @@ def auth(action): if not check_password_hash(user["password"], password): return show_error("login", "Incorrect password. Sorry.") elif action == "register": - if not ACCEPT_NEW_USERS: + if not config.getboolean("general", "accept_new_users"): return show_error("register", "Sorry, but user registrations are closed.") try: users.register(username, generate_password_hash(password), "en-US") -- cgit v1.2.3