Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update login.js #22

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions app/base/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,20 @@ def route_default():
return redirect(url_for('base_blueprint.login'))


@blueprint.route('/<path:u_path>')
def catch_all(u_path):
return render_template('errors/page_404.html'), 404


@blueprint.route('/<template>')
@login_required
def route_template(template):
return render_template(template + '.html')

try:
return render_template(template + '.html')
except:
return render_template('errors/page_404.html'), 404


@blueprint.route('/fixed_<template>')
@login_required
def route_fixed_template(template):
Expand Down
6 changes: 3 additions & 3 deletions app/base/static/build/js/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ function signup() { // eslint-disable-line no-unused-vars
dataType: 'json',
data: $('#create-user-form').serialize(),
success: function(result) {
if (result == 'duplicate') {
const message = 'Cannot create new user: duplicate entry.';
if (result !== 'success') {
const message = 'Error: ' + result;
alertify.notify(message, 'error', 5);
} else {
}else {
alertify.notify('New user created.', 'success', 5);
document.getElementById('login-button').click();
}
Expand Down