Add restart button

This commit is contained in:
David Hoppenbrouwers
2022-10-09 14:39:28 +02:00
parent 398858c34b
commit 1e7017a342
2 changed files with 15 additions and 0 deletions

10
main.py
View File

@@ -491,6 +491,16 @@ def admin_unban_user(user_id):
flash(str(e), 'error')
return redirect(url_for('admin'))
@app.route('/admin/restart/', methods = ['POST'])
def admin_restart():
chk, user = _admin_check()
if not chk:
return user
restart()
return redirect(url_for('admin'))
def _admin_check():
user = get_user()
if user is None: