improve flaks/audit for pet names

This commit is contained in:
Aaron Kimbre 2022-02-12 00:38:22 -06:00
parent 26cc2d431c
commit 24a398b89c

View File

@ -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"))