From 33d24745e1ed36ef3012d965282acb388f9716dc Mon Sep 17 00:00:00 2001 From: Aaron Kimbre Date: Mon, 4 Apr 2022 18:10:17 -0500 Subject: [PATCH] make key appear in flash if making a single key --- app/models.py | 1 + app/play_keys.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/models.py b/app/models.py index b2fe160..bdd2469 100644 --- a/app/models.py +++ b/app/models.py @@ -114,6 +114,7 @@ class PlayKey(db.Model): ) db.session.add(new_key) db.session.commit() + return key def delete(self): db.session.delete(self) diff --git a/app/play_keys.py b/app/play_keys.py index d6a0517..7109f6d 100644 --- a/app/play_keys.py +++ b/app/play_keys.py @@ -20,9 +20,9 @@ def index(): @login_required @gm_level(9) def create(count=1, uses=1): - PlayKey.create(count=count, uses=uses) + key = PlayKey.create(count=count, uses=uses) log_audit(f"Created {count} Play Key(s) with {uses} uses!") - flash(f"Created {count} Play Key(s) with {uses} uses!", "success") + flash(f"Created {count} Play Key(s) with {uses} uses! {key}", "success") return redirect(url_for('play_keys.index'))