Skip to content

Commit

Permalink
Merge pull request #1646 from codalab/develop
Browse files Browse the repository at this point in the history
Merge develop into master (small patch)
  • Loading branch information
Didayolo authored Nov 5, 2024
2 parents 919a5d1 + 84b3946 commit 6eda3ca
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/apps/analytics/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ def delete_orphan_files():
raise Exception("No storage inconsistency log file found")

# Get the list of orphan files from the content of the most recent log file
log_folder = "/app/logs/"
log_folder = "/app/var/logs/"
orphan_files_path = get_files_path_from_orphan_log_file(os.path.join(log_folder, most_recent_log_file), logger)

# Delete those files in batch (max 1000 element at once)
Expand All @@ -598,7 +598,7 @@ def delete_orphan_files():


def get_most_recent_storage_inconsistency_log_file(logger):
log_folder = "/app/logs/"
log_folder = "/app/var/logs/"
try:
log_files = [f for f in os.listdir(log_folder) if os.path.isfile(os.path.join(log_folder, f))]
except FileNotFoundError:
Expand Down
16 changes: 8 additions & 8 deletions src/apps/api/views/competitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from django.http import HttpResponse
from tempfile import SpooledTemporaryFile
from django.db import IntegrityError
from django.db.models import Subquery, OuterRef, Count, Q, F, Case, When
from django.db.models import Subquery, OuterRef, Count, Q, F
from django_filters.rest_framework import DjangoFilterBackend
from drf_yasg.utils import swagger_auto_schema, no_body
from rest_framework import status
Expand Down Expand Up @@ -168,13 +168,13 @@ def get_queryset(self):
'phases__leaderboard__columns',
'collaborators',
)
qs = qs.annotate(participant_count=Count(F('participants'), distinct=True))
qs = qs.annotate(submission_count=Count(
# Filtering out children submissions so we only count distinct submissions
Case(
When(phases__submissions__parent__isnull=True, then='phases__submissions__pk')
), distinct=True)
)
# qs = qs.annotate(participant_count=Count(F('participants'), distinct=True))
# qs = qs.annotate(submission_count=Count(
# # Filtering out children submissions so we only count distinct submissions
# Case(
# When(phases__submissions__parent__isnull=True, then='phases__submissions__pk')
# ), distinct=True)
# )

# search_query is true when called from searchbar
if search_query:
Expand Down

0 comments on commit 6eda3ca

Please sign in to comment.