forked from mirrors/bookwyrm
Fixes author page query
This commit is contained in:
parent
0601f68685
commit
28a8edfdc4
1 changed files with 2 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
||||||
""" the good people stuff! the authors! """
|
""" the good people stuff! the authors! """
|
||||||
from django.contrib.auth.decorators import login_required, permission_required
|
from django.contrib.auth.decorators import login_required, permission_required
|
||||||
from django.core.paginator import Paginator
|
from django.core.paginator import Paginator
|
||||||
|
from django.db.models import Q
|
||||||
from django.shortcuts import get_object_or_404, redirect
|
from django.shortcuts import get_object_or_404, redirect
|
||||||
from django.template.response import TemplateResponse
|
from django.template.response import TemplateResponse
|
||||||
from django.utils.decorators import method_decorator
|
from django.utils.decorators import method_decorator
|
||||||
|
@ -26,7 +27,7 @@ class Author(View):
|
||||||
return ActivitypubResponse(author.to_activity())
|
return ActivitypubResponse(author.to_activity())
|
||||||
|
|
||||||
books = models.Work.objects.filter(
|
books = models.Work.objects.filter(
|
||||||
authors=author, editions__authors=author
|
Q(authors=author) | Q(editions__authors=author)
|
||||||
).distinct()
|
).distinct()
|
||||||
|
|
||||||
paginated = Paginator(books, PAGE_LENGTH)
|
paginated = Paginator(books, PAGE_LENGTH)
|
||||||
|
|
Loading…
Reference in a new issue