Fix SignUp config feature

This commit is contained in:
Khanh Ngo 2016-06-13 11:48:48 +07:00
parent 729a5d0e9d
commit a14ccec39e
2 changed files with 7 additions and 1 deletions

View File

@ -92,7 +92,9 @@
<!-- /.col -->
</div>
</form>
{% if signup_enabled %}
<a href="{{ url_for('register') }}" class="text-center">Create an account </a>
{% endif %}
</div>
<!-- /.login-box-body -->
<div class="login-box-footer">

View File

@ -90,7 +90,11 @@ def error(code, msg=None):
@app.route('/register', methods=['GET'])
def register():
return render_template('register.html')
SIGNUP_ENABLED = app.config['SIGNUP_ENABLED']
if SIGNUP_ENABLED:
return render_template('register.html')
else:
return render_template('errors/404.html'), 404
@app.route('/login', methods=['GET', 'POST'])
@login_manager.unauthorized_handler