Initial subdomain implementation
This commit is contained in:
parent
dea24f7f71
commit
1628e63084
17 changed files with 194 additions and 46 deletions
|
@ -71,7 +71,7 @@ class Comment(MPTTModel):
|
|||
order_insertion_by = ["-time"]
|
||||
|
||||
@classmethod
|
||||
def most_recent(cls, user, n, batch=None):
|
||||
def most_recent(cls, user, n, batch=None, organization=None):
|
||||
queryset = (
|
||||
cls.objects.filter(hidden=False)
|
||||
.select_related("author__user")
|
||||
|
@ -79,6 +79,9 @@ class Comment(MPTTModel):
|
|||
.order_by("-id")
|
||||
)
|
||||
|
||||
if organization:
|
||||
queryset = queryset.filter(author__in=organization.members.all())
|
||||
|
||||
problem_access = CacheDict(
|
||||
lambda code: Problem.objects.get(code=code).is_accessible_by(user)
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue