diff options
author | Frederick Yin <fkfd@fkfd.me> | 2022-02-05 16:39:41 +0800 |
---|---|---|
committer | Frederick Yin <fkfd@fkfd.me> | 2022-02-05 16:39:41 +0800 |
commit | fcc3ce60bcfa57734a51723717fe681ee4bf1327 (patch) | |
tree | c8d883a6cd2b898fed85a7f717be34de242ded25 /jimbrella/auth.py | |
parent | 14feb6a4378668d054d28a1335eacd2026b621dc (diff) |
Config format switched to .ini
Eliminated toml from dependency list
Diffstat (limited to 'jimbrella/auth.py')
-rw-r--r-- | jimbrella/auth.py | 6 |
1 files changed, 3 insertions, 3 deletions
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") |