Commit c742bed 1 parent 05a42d8 commit c742bed Copy full SHA for c742bed
File tree 3 files changed +5
-4
lines changed
3 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -152,7 +152,7 @@ def can_see_detail(self, user):
152
152
elif source_visibility == SubmissionSourceAccess .SOLVED and \
153
153
(self .problem .is_public or self .problem .testers .filter (id = profile .id ).exists ()) and \
154
154
self .problem .submission_set .filter (user_id = profile .id , result = 'AC' ,
155
- points = self .problem .points ).exists ():
155
+ points__gte = self .problem .points ).exists ():
156
156
return True
157
157
elif source_visibility == SubmissionSourceAccess .ONLY_OWN and \
158
158
self .problem .testers .filter (id = profile .id ).exists ():
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ def contest_completed_ids(participation):
24
24
key = 'contest_complete:%d' % participation .id
25
25
result = cache .get (key )
26
26
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' ))
28
28
.values_list ('problem__problem__id' , flat = True ).distinct ())
29
29
cache .set (key , result , 86400 )
30
30
return result
@@ -34,7 +34,7 @@ def user_completed_ids(profile):
34
34
key = 'user_complete:%d' % profile .id
35
35
result = cache .get (key )
36
36
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' ))
38
38
.values_list ('problem_id' , flat = True ).distinct ())
39
39
cache .set (key , result , 86400 )
40
40
return result
Original file line number Diff line number Diff line change @@ -370,7 +370,8 @@ def get_normal_queryset(self):
370
370
filter |= Q (testers = self .profile )
371
371
queryset = Problem .objects .filter (filter ).select_related ('group' ).defer ('description' , 'summary' )
372
372
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' ))
374
375
.values_list ('problem__id' , flat = True ))
375
376
if self .show_types :
376
377
queryset = queryset .prefetch_related ('types' )
You can’t perform that action at this time.
0 commit comments