mirror of
https://github.com/DarkflameUniverse/NexusDashboard.git
synced 2024-08-30 18:12:11 +00:00
improve flaks/audit for pet names
This commit is contained in:
parent
26cc2d431c
commit
24a398b89c
@ -23,8 +23,8 @@ def approve_pet(id):
|
|||||||
pet_data = PetNames.query.filter(PetNames.id == id).first()
|
pet_data = PetNames.query.filter(PetNames.id == id).first()
|
||||||
|
|
||||||
pet_data.approved = 2
|
pet_data.approved = 2
|
||||||
log_audit(f"Approved pet name {pet_data.pet_name}")
|
log_audit(f"Approved pet name {pet_data.pet_name} from {pet_data.owner.name}")
|
||||||
flash(f"Approved pet name {pet_data.pet_name}", "success")
|
flash(f"Approved pet name {pet_data.pet_name} from {pet_data.owner.name}", "success")
|
||||||
pet_data.save()
|
pet_data.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"))
|
||||||
|
|
||||||
@ -37,8 +37,8 @@ def reject_pet(id):
|
|||||||
pet_data = PetNames.query.filter(PetNames.id == id).first()
|
pet_data = PetNames.query.filter(PetNames.id == id).first()
|
||||||
|
|
||||||
pet_data.approved = 0
|
pet_data.approved = 0
|
||||||
log_audit(f"Rejected pet name {pet_data.pet_name}")
|
log_audit(f"Rejected pet name {pet_data.pet_name} from {pet_data.owner.name}")
|
||||||
flash(f"Rejected pet name {pet_data.pet_name}", "danger")
|
flash(f"Rejected pet name {pet_data.pet_name} from {pet_data.owner.name}", "danger")
|
||||||
pet_data.save()
|
pet_data.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