make key appear in flash if making a single key

This commit is contained in:
Aaron Kimbre 2022-04-04 18:10:17 -05:00
parent 8e58b0bc1f
commit 33d24745e1
2 changed files with 3 additions and 2 deletions

View File

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

View File

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