Issue-3187: change variable name and code formatting

This commit is contained in:
Rohan Sureshkumar 2024-01-18 21:23:25 +05:30
parent d73141792d
commit 8e2649ba3b
2 changed files with 3 additions and 4 deletions

View file

@ -41,7 +41,7 @@
</section>
{% endif %}
{% if annual_summary_year and tab.key == 'home' and has_read_throughs %}
{% if annual_summary_year and tab.key == 'home' and has_summary_read_throughs %}
<section class="block is-hidden" data-hide="hide_annual_summary_{{ annual_summary_year }}">
{% include 'feed/summary_card.html' with year=annual_summary_year %}
<hr>

View file

@ -54,8 +54,7 @@ class Feed(View):
suggestions = suggested_users.get_suggestions(request.user)
cutoff = date(get_annual_summary_year(), 12, 31)
readthroughs = models.ReadThrough.objects.filter(
user=request.user,
finish_date__lte=cutoff
user=request.user, finish_date__lte=cutoff
)
data = {
@ -72,7 +71,7 @@ class Feed(View):
"path": f"/{tab['key']}",
"annual_summary_year": get_annual_summary_year(),
"has_tour": True,
"has_read_throughs": len(readthroughs) > 0,
"has_summary_read_throughs": len(readthroughs),
},
}
return TemplateResponse(request, "feed/feed.html", data)