mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-25 11:01:12 +00:00
Merge branch 'main' into export-fixes
This commit is contained in:
commit
5f2f321ed5
6 changed files with 27 additions and 3 deletions
|
@ -141,3 +141,6 @@ CSP_ADDITIONAL_HOSTS=
|
||||||
# Increase if users are having trouble uploading BookWyrm export files.
|
# Increase if users are having trouble uploading BookWyrm export files.
|
||||||
# Default value is 100MB
|
# 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
|
|
@ -30,6 +30,9 @@ RELEASE_API = env(
|
||||||
|
|
||||||
PAGE_LENGTH = env.int("PAGE_LENGTH", 15)
|
PAGE_LENGTH = env.int("PAGE_LENGTH", 15)
|
||||||
DEFAULT_LANGUAGE = env("DEFAULT_LANGUAGE", "English")
|
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"
|
JS_CACHE = "8a89cad7"
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
</section>
|
</section>
|
||||||
{% endif %}
|
{% 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 }}">
|
<section class="block is-hidden" data-hide="hide_annual_summary_{{ annual_summary_year }}">
|
||||||
{% include 'feed/summary_card.html' with year=annual_summary_year %}
|
{% include 'feed/summary_card.html' with year=annual_summary_year %}
|
||||||
<hr>
|
<hr>
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
""" non-interactive pages """
|
""" non-interactive pages """
|
||||||
|
from datetime import date
|
||||||
from django.contrib.auth.decorators import login_required
|
from django.contrib.auth.decorators import login_required
|
||||||
from django.core.paginator import Paginator
|
from django.core.paginator import Paginator
|
||||||
from django.db.models import Q
|
from django.db.models import Q
|
||||||
|
@ -52,6 +53,19 @@ class Feed(View):
|
||||||
|
|
||||||
suggestions = suggested_users.get_suggestions(request.user)
|
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 = {
|
data = {
|
||||||
**feed_page_data(request.user),
|
**feed_page_data(request.user),
|
||||||
**{
|
**{
|
||||||
|
@ -66,6 +80,7 @@ class Feed(View):
|
||||||
"path": f"/{tab['key']}",
|
"path": f"/{tab['key']}",
|
||||||
"annual_summary_year": get_annual_summary_year(),
|
"annual_summary_year": get_annual_summary_year(),
|
||||||
"has_tour": True,
|
"has_tour": True,
|
||||||
|
"has_summary_read_throughs": len(readthroughs),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
return TemplateResponse(request, "feed/feed.html", data)
|
return TemplateResponse(request, "feed/feed.html", data)
|
||||||
|
|
|
@ -2,6 +2,9 @@ bind 127.0.0.1 ::1
|
||||||
protected-mode yes
|
protected-mode yes
|
||||||
port 6379
|
port 6379
|
||||||
|
|
||||||
|
auto-aof-rewrite-percentage 50
|
||||||
|
auto-aof-rewrite-min-size 128mb
|
||||||
|
|
||||||
rename-command FLUSHDB ""
|
rename-command FLUSHDB ""
|
||||||
rename-command FLUSHALL ""
|
rename-command FLUSHALL ""
|
||||||
rename-command DEBUG ""
|
rename-command DEBUG ""
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
aiohttp==3.9.0
|
aiohttp==3.9.2
|
||||||
bleach==5.0.1
|
bleach==5.0.1
|
||||||
celery==5.2.7
|
celery==5.2.7
|
||||||
colorthief==0.2.1
|
colorthief==0.2.1
|
||||||
|
|
Loading…
Reference in a new issue