diff options
| author | Raghuram Subramani <raghus2247@gmail.com> | 2025-05-12 05:25:31 +0000 |
|---|---|---|
| committer | Raghuram Subramani <raghus2247@gmail.com> | 2025-05-12 05:25:31 +0000 |
| commit | 9eeb3f87a015a668e837b67410e23c4b34e248af (patch) | |
| tree | 601c464ed8c04f5aba7a34caa37995e86fde7a7f /web/app/main.py | |
| parent | d7b0d4e4f94d928899887407fc131c808e8aa916 (diff) | |
update
Diffstat (limited to 'web/app/main.py')
| -rw-r--r-- | web/app/main.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/web/app/main.py b/web/app/main.py index 1266cb8..cc141b8 100644 --- a/web/app/main.py +++ b/web/app/main.py @@ -36,6 +36,7 @@ def logout(): def create_user(): username = request.form.get('username') password = request.form.get('password') + admin = request.form.get('admin') if current_user.admin != True: flash('Only admin can create new users.', 'error') @@ -45,7 +46,7 @@ def create_user(): flash('Username and password required.', 'error') return redirect(url_for('main.home')) - user = User.create(username, password) + user = User.create(username, password, admin == 'on') if user: flash(f'User {username} created successfully.', 'success') else: |
