Skip to content

Commit c742bed

Browse files
committed
don't pr this, it conflicts with DMOJ#1645
1 parent 05a42d8 commit c742bed

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

judge/models/submission.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def can_see_detail(self, user):
152152
elif source_visibility == SubmissionSourceAccess.SOLVED and \
153153
(self.problem.is_public or self.problem.testers.filter(id=profile.id).exists()) and \
154154
self.problem.submission_set.filter(user_id=profile.id, result='AC',
155-
points=self.problem.points).exists():
155+
points__gte=self.problem.points).exists():
156156
return True
157157
elif source_visibility == SubmissionSourceAccess.ONLY_OWN and \
158158
self.problem.testers.filter(id=profile.id).exists():

judge/utils/problems.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def contest_completed_ids(participation):
2424
key = 'contest_complete:%d' % participation.id
2525
result = cache.get(key)
2626
if result is None:
27-
result = set(participation.submissions.filter(submission__result='AC', points=F('problem__points'))
27+
result = set(participation.submissions.filter(submission__result='AC', points__gte=F('problem__points'))
2828
.values_list('problem__problem__id', flat=True).distinct())
2929
cache.set(key, result, 86400)
3030
return result
@@ -34,7 +34,7 @@ def user_completed_ids(profile):
3434
key = 'user_complete:%d' % profile.id
3535
result = cache.get(key)
3636
if result is None:
37-
result = set(Submission.objects.filter(user=profile, result='AC', points=F('problem__points'))
37+
result = set(Submission.objects.filter(user=profile, result='AC', points__gte=F('problem__points'))
3838
.values_list('problem_id', flat=True).distinct())
3939
cache.set(key, result, 86400)
4040
return result

judge/views/problem.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,8 @@ def get_normal_queryset(self):
370370
filter |= Q(testers=self.profile)
371371
queryset = Problem.objects.filter(filter).select_related('group').defer('description', 'summary')
372372
if self.profile is not None and self.hide_solved:
373-
queryset = queryset.exclude(id__in=Submission.objects.filter(user=self.profile, points=F('problem__points'))
373+
queryset = queryset.exclude(id__in=Submission.objects
374+
.filter(user=self.profile, points__gte=F('problem__points'))
374375
.values_list('problem__id', flat=True))
375376
if self.show_types:
376377
queryset = queryset.prefetch_related('types')

0 commit comments

Comments
 (0)