forked from cms-dev/cms
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed submissions status in AWS overview.
It seems that the union query is not guaranteed to return results in order.
- Loading branch information
Showing
1 changed file
with
2 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
# Copyright © 2012-2016 Luca Wehrstedt <[email protected]> | ||
# Copyright © 2014 Artem Iglikov <[email protected]> | ||
# Copyright © 2014 Fabian Gundlach <[email protected]> | ||
# Copyright © 2020 Vytis Banaitis <[email protected]> | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as | ||
|
@@ -176,13 +177,8 @@ def submissions_status(contest_id): | |
.filter(Task.contest_id == contest_id) | ||
queries['total'] = total_query | ||
|
||
stats = {} | ||
keys = list(queries.keys()) | ||
results = queries[keys[0]].union_all( | ||
*(queries[key] for key in keys[1:])).all() | ||
stats = {key: queries[key].one()[0] for key, query in queries.items()} | ||
|
||
for i, k in enumerate(keys): | ||
stats[k] = results[i][0] | ||
stats['compiling'] += 2 * stats['total'] - sum(stats.values()) | ||
|
||
return stats |