check hole name and give error

master
Aevann 2024-04-28 16:36:43 +03:00
parent 6ec74490ff
commit 47ac2cfd41
1 changed files with 4 additions and 0 deletions

View File

@ -53,6 +53,10 @@ def submit_art_post(v):
hole = request.values.get('hole', '').lower().strip()
if not hole: hole = None
if hole:
hole = g.db.get(Hole, hole)
if not hole:
abort(404, "Hole not found!")
entry = ArtSubmission(
kind=kind,