Skip to content

Commit

Permalink
group: Only show input acceptance flash if one was actually uploaded
Browse files Browse the repository at this point in the history
  • Loading branch information
jackrosenthal committed Feb 27, 2024
1 parent c6e6f87 commit ad5dc4b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion algobowl/controllers/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,13 @@ def input_upload(self, input_upload=None, team_name=None):
):
abort(403, "Sorry, input upload stage is closed.")

input_uploaded = False
if hasattr(input_upload, "file"):
result = self.input_upload_api(input_upload)
if result["status"] != "success":
flash(result["msg"], "danger")
redirect(self.base_url)
input_uploaded = True

if team_name is not None:
if len(team_name) >= 100:
Expand All @@ -175,7 +177,8 @@ def input_upload(self, input_upload=None, team_name=None):

self.group.name = team_name

flash("Thank you. Your input has been accepted!", "success")
if input_uploaded:
flash("Thank you. Your input has been accepted!", "success")
redirect(self.base_url)

@expose("json")
Expand Down

0 comments on commit ad5dc4b

Please sign in to comment.