forked from mirrors/bookwyrm
Don't show following years' books in a year's goal
This commit is contained in:
parent
08346b7f87
commit
e34ae18e98
1 changed files with 6 additions and 2 deletions
|
@ -372,7 +372,10 @@ class AnnualGoal(BookWyrmModel):
|
|||
def books(self):
|
||||
"""the books you've read this year"""
|
||||
return (
|
||||
self.user.readthrough_set.filter(finish_date__year__gte=self.year)
|
||||
self.user.readthrough_set.filter(
|
||||
finish_date__year__gte=self.year,
|
||||
finish_date__year__lt=self.year + 1,
|
||||
)
|
||||
.order_by("-finish_date")
|
||||
.all()
|
||||
)
|
||||
|
@ -396,7 +399,8 @@ class AnnualGoal(BookWyrmModel):
|
|||
def book_count(self):
|
||||
"""how many books you've read this year"""
|
||||
return self.user.readthrough_set.filter(
|
||||
finish_date__year__gte=self.year
|
||||
finish_date__year__gte=self.year,
|
||||
finish_date__year__lt=self.year + 1,
|
||||
).count()
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue