Merge branch 'main' into export-fixes

This commit is contained in:
Mouse Reeve 2024-02-03 07:04:05 -08:00 committed by GitHub
commit 5f2f321ed5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 27 additions and 3 deletions

View file

@ -140,4 +140,7 @@ CSP_ADDITIONAL_HOSTS=
# Increase if users are having trouble uploading BookWyrm export files.
# Default value is 100MB
DATA_UPLOAD_MAX_MEMORY_SIZE=104857600
DATA_UPLOAD_MAX_MEMORY_SIZE=104857600
# Time before being logged out (in seconds)
# SESSION_COOKIE_AGE=2592000 # current default: 30 days

View file

@ -30,6 +30,9 @@ RELEASE_API = env(
PAGE_LENGTH = env.int("PAGE_LENGTH", 15)
DEFAULT_LANGUAGE = env("DEFAULT_LANGUAGE", "English")
# TODO: extend maximum age to 1 year once termination of active sessions
# is implemented (see bookwyrm-social#2278, bookwyrm-social#3082).
SESSION_COOKIE_AGE = env.int("SESSION_COOKIE_AGE", 3600 * 24 * 30) # 1 month
JS_CACHE = "8a89cad7"

View file

@ -41,7 +41,7 @@
</section>
{% endif %}
{% if annual_summary_year and tab.key == 'home' %}
{% 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

@ -1,4 +1,5 @@
""" non-interactive pages """
from datetime import date
from django.contrib.auth.decorators import login_required
from django.core.paginator import Paginator
from django.db.models import Q
@ -52,6 +53,19 @@ class Feed(View):
suggestions = suggested_users.get_suggestions(request.user)
cutoff = (
date(get_annual_summary_year(), 12, 31)
if get_annual_summary_year()
else None
)
readthroughs = (
models.ReadThrough.objects.filter(
user=request.user, finish_date__lte=cutoff
)
if get_annual_summary_year()
else []
)
data = {
**feed_page_data(request.user),
**{
@ -66,6 +80,7 @@ class Feed(View):
"path": f"/{tab['key']}",
"annual_summary_year": get_annual_summary_year(),
"has_tour": True,
"has_summary_read_throughs": len(readthroughs),
},
}
return TemplateResponse(request, "feed/feed.html", data)

View file

@ -2,6 +2,9 @@ bind 127.0.0.1 ::1
protected-mode yes
port 6379
auto-aof-rewrite-percentage 50
auto-aof-rewrite-min-size 128mb
rename-command FLUSHDB ""
rename-command FLUSHALL ""
rename-command DEBUG ""

View file

@ -1,4 +1,4 @@
aiohttp==3.9.0
aiohttp==3.9.2
bleach==5.0.1
celery==5.2.7
colorthief==0.2.1