Development
This commit is contained in:
parent
563d82daf3
commit
70ccfe2c29
48 changed files with 549 additions and 578 deletions
|
|
@ -3,8 +3,8 @@ from flask import Blueprint, request, session, redirect, flash
|
|||
import json, os, bcrypt, secrets, smtplib
|
||||
from datetime import datetime, timezone, timedelta
|
||||
from email.message import EmailMessage
|
||||
from auth import require_level
|
||||
from config_utils import WEB_APP_DISPLAY_NAME, ACCOUNTS_FILE
|
||||
import auth
|
||||
import config_utils
|
||||
import sanitize
|
||||
|
||||
_PAGE = Path(__file__).parent.name
|
||||
|
|
@ -16,7 +16,7 @@ CODE_TTL_MIN = 15
|
|||
|
||||
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': []}
|
||||
|
|
@ -33,7 +33,7 @@ def _send_verification_email(to_address, code):
|
|||
raise RuntimeError('SMTP_HOST is not configured.')
|
||||
|
||||
msg = EmailMessage()
|
||||
msg['Subject'] = f'{WEB_APP_DISPLAY_NAME} - Email Verification'
|
||||
msg['Subject'] = f'{config_utils.WEB_APP_DISPLAY_NAME} - Email Verification'
|
||||
msg['From'] = from_addr
|
||||
msg['To'] = to_address
|
||||
msg.set_content(
|
||||
|
|
@ -52,7 +52,7 @@ def _send_verification_email(to_address, code):
|
|||
|
||||
|
||||
@bp.route('/action/accountcreate/form_create', methods=['POST'])
|
||||
@require_level('nothing')
|
||||
@auth.require_level('nothing')
|
||||
def form_create():
|
||||
# Abort if already logged in
|
||||
if session.get('access_level', 'nothing') != 'nothing':
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import json
|
||||
import sanitize
|
||||
from config_utils import collect_layout_tokens
|
||||
import config_utils
|
||||
|
||||
|
||||
def collect_tokens(cfg):
|
||||
tokens = collect_layout_tokens(cfg)
|
||||
tokens = config_utils.collect_layout_tokens(cfg)
|
||||
blank = [{'value': '', 'label': '-- Select timezone --'}]
|
||||
tokens['TIMEZONE_OPTIONS'] = json.dumps(blank + [{'value': tz, 'label': tz} for tz in sanitize.VALID_TIMEZONES])
|
||||
return tokens
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue