Skip to content

Commit

Permalink
Move the contest_id checks in submission_scored/tokened
Browse files Browse the repository at this point in the history
  • Loading branch information
edomora97 authored and andreyv committed Dec 14, 2021
1 parent a0c8be8 commit fe0d48f
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions cms/service/ProxyService.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,10 +387,6 @@ def operations_for_score(self, submission):
queues for them to be sent to rankings.
"""
# ScoringService sent us a submission of another contest.
if submission.task.contest_id != self.contest_id:
return []

submission_result = submission.get_result()

# Data to send to remote rankings.
Expand Down Expand Up @@ -427,9 +423,6 @@ def operations_for_token(self, submission):
queues for them to be sent to rankings.
"""
# ScoringService sent us a submission of another contest.
if submission.task.contest_id != self.contest_id:
return []
# Data to send to remote rankings.
submission_id = "%d" % submission.id
submission_data = {
Expand Down Expand Up @@ -496,6 +489,11 @@ def submission_scored(self, submission_id):
submission_id)
return

# ScoringService sent us a submission of another contest, they
# do not know about our contest_id in multicontest setup.
if submission.task.contest_id != self.contest_id:
return

# Update RWS.
for operation in self.operations_for_score(submission):
self.enqueue(operation)
Expand Down Expand Up @@ -531,6 +529,11 @@ def submission_tokened(self, submission_id):
submission_id)
return

# ScoringService sent us a submission of another contest, they
# do not know about our contest_id in multicontest setup.
if submission.task.contest_id != self.contest_id:
return

# Update RWS.
for operation in self.operations_for_token(submission):
self.enqueue(operation)
Expand Down

0 comments on commit fe0d48f

Please sign in to comment.