Skip to content

Commit

Permalink
Remove superuser optimizations (#1421)
Browse files Browse the repository at this point in the history
This optimization does not work with the current caching of comment titles, and masks potential performance issues.
  • Loading branch information
quantum5 authored Jun 3, 2020
1 parent 50ba7b3 commit 2105b60
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions judge/models/comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ def most_recent(cls, user, n, batch=None):
contest_access = CacheDict(lambda key: contest_cache[key].is_accessible_by(user))
blog_access = CacheDict(lambda id: blog_cache[id].can_see(user))

if user.is_superuser:
return queryset[:n]
if batch is None:
batch = 2 * n
output = []
Expand Down

0 comments on commit 2105b60

Please sign in to comment.