Skip to content
Snippets Groups Projects

Implementace dělených kol pomocí RoundPart

Closed Jiří Setnička requested to merge jirka/delena-kola2 into devel
1 unresolved thread
8 files
+ 23
17
Compare changes
  • Side-by-side
  • Inline
Files
8
+ 5
3
@@ -227,7 +227,9 @@ def handle_upload_feedback(the_job: TheJob):
contest_dict[user.user_id] = contest
site_id_dict[user.user_id] = pion.place_id
rr = the_job.gatekeeper.rights_for_contest(contest)
user_rights[user.user_id] = rr.can_upload_feedback(round)
user_rights[user.user_id] = {
part.round_part_id: rr.can_upload_feedback(part) for part in round.parts
}
for f in files:
f.user = user_dict[f.user_id]
@@ -237,8 +239,8 @@ def handle_upload_feedback(the_job: TheJob):
the_job.error(f'{f.file_name}: Účastník leží mimo vybranou soutěž')
elif only_site_id is not None and site_id_dict[f.user_id] != only_site_id:
the_job.error(f'{f.file_name}: Účastník leží mimo vybrané soutěžní místo')
elif not user_rights[f.user_id]:
the_job.error(f'{f.file_name}: K tomuto účastníkovi nemáte dostatečná oprávnění')
elif not user_rights[f.user_id][f.task.round_part_id]:
the_job.error(f'{f.file_name}: K tomuto účastníkovi a úloze nemáte dostatečná oprávnění')
def process_file(fb: UploadFeedback) -> bool:
assert fb.user and fb.task
Loading