Skip to content

Commit

Permalink
Merge pull request #1654 from LibraryOfCongress/1556-campaign-profie-…
Browse files Browse the repository at this point in the history
…sorting

revert sorting
  • Loading branch information
rabiloc authored Mar 29, 2022
2 parents 629581e + a22406d commit 49e3399
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions concordia/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ class AccountProfileView(LoginRequiredMixin, FormView, ListView):
# presented in the template as a standard paginated list of Asset
# instances with annotations
allow_empty = True
paginate_by = 12
paginate_by = 30

def post(self, *args, **kwargs):
self.object_list = self.get_queryset()
Expand All @@ -502,20 +502,19 @@ def get_queryset(self):
assets = Asset.objects.filter(
transcription__in=transcriptions,
item__project__campaign__pk=campaignSlug,
).order_by("-last_transcribed", "-last_reviewed", "-id")
).order_by("-last_transcribed")
else:
campaignSlug = -1
assets = Asset.objects.filter(transcription__in=transcriptions).order_by(
"-last_transcribed", "-last_reviewed", "-id"
"-last_transcribed"
)

assets = assets.select_related(
"item", "item__project", "item__project__campaign"
)

assets = assets.annotate(
last_transcribed=Max(
"transcription__updated_on",
"transcription__created_on",
filter=Q(transcription__user=self.request.user),
),
last_reviewed=Max(
Expand Down

0 comments on commit 49e3399

Please sign in to comment.