Skip to content

Commit

Permalink
Merge pull request #409 from sparcs-kaist/fix/article-n-plus-one
Browse files Browse the repository at this point in the history
Fix article board group N+1 query problem
  • Loading branch information
injoonH committed Aug 10, 2023
2 parents 9ca99c5 + 9a4f3f4 commit fe0caab
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apps/core/views/viewsets/article.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ def filter_queryset(self, queryset):
"created_by__profile",
"parent_topic",
"parent_board",
"parent_board__group",
).prefetch_related(
ArticleReadLog.prefetch_my_article_read_log(self.request.user),
)
Expand All @@ -119,6 +120,7 @@ def filter_queryset(self, queryset):
"created_by__profile",
"parent_topic",
"parent_board",
"parent_board__group",
).prefetch_related(
"attachments",
models.Prefetch(
Expand Down

0 comments on commit fe0caab

Please sign in to comment.