Merge pull request #2033 from bookwyrm-social/author-sort

Reverts author view changes
This commit is contained in:
Mouse Reeve 2022-03-17 08:51:06 -07:00 committed by GitHub
commit ef4e06ad52
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,7 +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 Avg, Q 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
@ -28,8 +28,7 @@ class Author(View):
books = ( books = (
models.Work.objects.filter(Q(authors=author) | Q(editions__authors=author)) models.Work.objects.filter(Q(authors=author) | Q(editions__authors=author))
.annotate(Avg("editions__review__rating")) .order_by("created_date")
.order_by("editions__review__rating__avg")
.distinct() .distinct()
) )