Development

This commit is contained in:
Matthew Grotke 2026-06-07 00:21:08 -04:00
parent 563d82daf3
commit 70ccfe2c29
48 changed files with 549 additions and 578 deletions

View file

@ -2,8 +2,8 @@ from pathlib import Path
from flask import Blueprint, request, session, redirect, flash
import json, os, secrets
from datetime import datetime, timezone, timedelta
from auth import require_level
from config_utils import ACCOUNTS_FILE
import auth
import config_utils
_PAGE = Path(__file__).parent.name
@ -13,18 +13,18 @@ bp = Blueprint(_PAGE, __name__)
def _load_accounts():
try:
with open(ACCOUNTS_FILE) as f:
with open(config_utils.ACCOUNTS_FILE) as f:
return json.load(f)
except Exception:
return {'accounts': []}
def _save_accounts(data):
with open(ACCOUNTS_FILE, 'w') as f:
with open(config_utils.ACCOUNTS_FILE, 'w') as f:
json.dump(data, f, indent=2)
@bp.route('/action/accountverifyemail/email_verify', methods=['POST'])
@require_level('nothing')
@auth.require_level('nothing')
def email_verify():
# Abort if already logged in
if session.get('access_level', 'nothing') != 'nothing':
@ -84,7 +84,7 @@ def email_verify():
@bp.route('/action/accountverifyemail/email_resend')
@require_level('nothing')
@auth.require_level('nothing')
def email_resend():
# Abort if already logged in
if session.get('access_level', 'nothing') != 'nothing':

View file

@ -1,5 +1,5 @@
from config_utils import collect_layout_tokens
import config_utils
def collect_tokens(cfg):
return collect_layout_tokens(cfg)
return config_utils.collect_layout_tokens(cfg)