Move dirty logic to admin
This commit is contained in:
parent
e1a38d42c3
commit
11bc57f2b1
4 changed files with 38 additions and 31 deletions
|
@ -436,15 +436,23 @@ class Problem(models.Model, PageVotable, Bookmarkable):
|
|||
|
||||
@cached_property
|
||||
def author_ids(self):
|
||||
return self.authors.values_list("id", flat=True)
|
||||
return Problem.authors.through.objects.filter(problem=self).values_list(
|
||||
"profile_id", flat=True
|
||||
)
|
||||
|
||||
@cached_property
|
||||
def editor_ids(self):
|
||||
return self.author_ids | self.curators.values_list("id", flat=True)
|
||||
return self.author_ids.union(
|
||||
Problem.curators.through.objects.filter(problem=self).values_list(
|
||||
"profile_id", flat=True
|
||||
)
|
||||
)
|
||||
|
||||
@cached_property
|
||||
def tester_ids(self):
|
||||
return self.testers.values_list("id", flat=True)
|
||||
return Problem.testers.through.objects.filter(problem=self).values_list(
|
||||
"profile_id", flat=True
|
||||
)
|
||||
|
||||
@cached_property
|
||||
def usable_common_names(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue