mirror of
https://github.com/DarkflameUniverse/NexusDashboard.git
synced 2024-11-25 15:07:18 +00:00
explicitly set these not so there's no guessing
This commit is contained in:
parent
c32da45a16
commit
413a2c06a4
@ -61,15 +61,17 @@ def edit_gm_level(id):
|
|||||||
@gm_level(3)
|
@gm_level(3)
|
||||||
def lock(id):
|
def lock(id):
|
||||||
account = Account.query.filter(Account.id == id).first()
|
account = Account.query.filter(Account.id == id).first()
|
||||||
account.locked = not account.locked
|
if not account.locked:
|
||||||
account.active = account.locked
|
account.locked = True
|
||||||
account.save()
|
account.active = False
|
||||||
if account.locked:
|
|
||||||
log_audit(f"Locked ({account.id}){account.username}")
|
log_audit(f"Locked ({account.id}){account.username}")
|
||||||
flash("Locked Account", "danger")
|
flash("Locked Account", "danger")
|
||||||
else:
|
else:
|
||||||
|
account.locked = False
|
||||||
|
account.active = True
|
||||||
log_audit(f"Unlocked ({account.id}){account.username}")
|
log_audit(f"Unlocked ({account.id}){account.username}")
|
||||||
flash("Unlocked account", "success")
|
flash("Unlocked account", "success")
|
||||||
|
account.save()
|
||||||
return redirect(request.referrer if request.referrer else url_for("main.index"))
|
return redirect(request.referrer if request.referrer else url_for("main.index"))
|
||||||
|
|
||||||
|
|
||||||
@ -80,13 +82,18 @@ def ban(id):
|
|||||||
account = Account.query.filter(Account.id == id).first()
|
account = Account.query.filter(Account.id == id).first()
|
||||||
account.banned = not account.banned
|
account.banned = not account.banned
|
||||||
account.active = account.banned
|
account.active = account.banned
|
||||||
account.save()
|
|
||||||
if account.banned:
|
if not account.banned:
|
||||||
|
account.banned = True
|
||||||
|
account.active = False
|
||||||
log_audit(f"Banned ({account.id}){account.username}")
|
log_audit(f"Banned ({account.id}){account.username}")
|
||||||
flash("Banned Account", "danger")
|
flash("Banned Account", "danger")
|
||||||
else:
|
else:
|
||||||
|
account.banned = False
|
||||||
|
account.active = True
|
||||||
log_audit(f"Unbanned ({account.id}){account.username}")
|
log_audit(f"Unbanned ({account.id}){account.username}")
|
||||||
flash("Unbanned account", "success")
|
flash("Unbanned account", "success")
|
||||||
|
account.save()
|
||||||
return redirect(request.referrer if request.referrer else url_for("main.index"))
|
return redirect(request.referrer if request.referrer else url_for("main.index"))
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user