Skip to content

Commit

Permalink
ENH make event approval more robust to concurrent approval
Browse files Browse the repository at this point in the history
  • Loading branch information
tomMoral committed Mar 4, 2024
1 parent 97fbb52 commit fddc2e4
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions ramp-database/ramp_database/tools/team.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from ..model import EventTeam

from .submission import add_submission
from .submission import DuplicateSubmissionError

from ._query import select_event_by_name
from ._query import select_event_team_by_name
Expand Down Expand Up @@ -65,13 +66,19 @@ def sign_up_team(session, event_name, team_name):
event.problem.path_ramp_kit, "submissions", event.ramp_sandbox_name
)
submission_name = event.ramp_sandbox_name
submission = add_submission(
session,
event_name,
team_name,
submission_name,
path_sandbox_submission,
)
try:
submission = add_submission(
session,
event_name,
team_name,
submission_name,
path_sandbox_submission,
)
except DuplicateSubmissionError:
logger.info(

Check warning on line 78 in ramp-database/ramp_database/tools/team.py

View check run for this annotation

Codecov / codecov/patch

ramp-database/ramp_database/tools/team.py#L77-L78

Added lines #L77 - L78 were not covered by tests
"Sanbox submission already exists. "
"This probably due to concurrent approval, skipping."
)
logger.info("Copying the submission files into the deployment folder")
logger.info("Adding {}".format(submission))
event_team.approved = True
Expand Down

0 comments on commit fddc2e4

Please sign in to comment.