add registration switch env

This commit is contained in:
2024-08-08 16:10:43 +00:00
parent 92b314623a
commit 8f95303d11
4 changed files with 21 additions and 16 deletions

View File

@ -77,6 +77,9 @@ def logout():
def register():
if current_user.is_authenticated:
return redirect(url_for('index'))
if not app.config['ALLOW_REGISTRATION'] == "true":
flash('Registration temporarily disabled.')
return redirect(url_for('login'))
form = RegistrationForm()
if form.validate_on_submit():
user = User(username=form.username.data, email=form.email.data)