diff options
Diffstat (limited to 'ogcp')
-rw-r--r-- | ogcp/views.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/ogcp/views.py b/ogcp/views.py index 93514a3..83a0e4d 100644 --- a/ogcp/views.py +++ b/ogcp/views.py @@ -3023,7 +3023,7 @@ def save_user(form, preserve_pwd): pwd_hash_confirm = hash_password(form.pwd_confirm.data) if not pwd_hash == pwd_hash_confirm: flash(_('Passwords do not match'), category='error') - return redirect(url_for('users')) + return False admin = form.admin.data scopes = form.scopes.data @@ -3085,7 +3085,7 @@ def save_user(form, preserve_pwd): app.config['USERS'].remove(old_user) app.config['USERS'].append(user) - return redirect(url_for('users')) + return True def delete_user(username): @@ -3127,7 +3127,9 @@ def user_add_post(): flash(_('This username already exists'), category='error') return redirect(url_for('users')) - return save_user(form, preserve_pwd=False) + if save_user(form, preserve_pwd=False): + flash(_('User created successfully'), category='info') + return redirect(url_for('users')) @app.route('/user/edit', methods=['GET']) @@ -3200,7 +3202,9 @@ def user_edit_post(): if preserve_pwd: form.pwd.data = old_user_data.get("PASS") - return save_user(form, preserve_pwd) + if save_user(form, preserve_pwd): + flash(_('User edited successfully'), category='info') + return redirect(url_for('users')) @app.route('/user/delete', methods=['GET']) |