forked from mirrors/bookwyrm
Merge branch 'main' into production
This commit is contained in:
commit
9ad369203f
5 changed files with 175 additions and 152 deletions
|
@ -359,6 +359,10 @@ class CollectionItemMixin(ActivitypubMixin):
|
|||
|
||||
activity_serializer = activitypub.CollectionItem
|
||||
|
||||
def broadcast(self, activity, sender, software="bookwyrm"):
|
||||
""" only send book collection updates to other bookwyrm instances """
|
||||
super().broadcast(activity, sender, software=software)
|
||||
|
||||
@property
|
||||
def privacy(self):
|
||||
""" inherit the privacy of the list, or direct if pending """
|
||||
|
@ -371,6 +375,9 @@ class CollectionItemMixin(ActivitypubMixin):
|
|||
def recipients(self):
|
||||
""" the owner of the list is a direct recipient """
|
||||
collection_field = getattr(self, self.collection_field)
|
||||
if collection_field.user.local:
|
||||
# don't broadcast to yourself
|
||||
return []
|
||||
return [collection_field.user]
|
||||
|
||||
def save(self, *args, broadcast=True, **kwargs):
|
||||
|
|
|
@ -3,6 +3,12 @@ html {
|
|||
scroll-padding-top: 20%;
|
||||
}
|
||||
|
||||
body {
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.image {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
|
|
@ -22,7 +22,8 @@
|
|||
<meta name="twitter:image:alt" content="BookWyrm Logo">
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar container" aria-label="main navigation">
|
||||
<nav class="navbar" aria-label="main navigation">
|
||||
<div class="container">
|
||||
<div class="navbar-brand">
|
||||
<a class="navbar-item" href="/">
|
||||
<img class="image logo" src="{% if site.logo_small %}/images/{{ site.logo_small }}{% else %}/static/images/logo-small.png{% endif %}" alt="Home page">
|
||||
|
@ -175,13 +176,16 @@
|
|||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
|
||||
<div class="section container">
|
||||
<div class="section is-flex-grow-1">
|
||||
<div class="container">
|
||||
{% block content %}
|
||||
{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
<div class="container">
|
||||
|
|
|
@ -55,7 +55,7 @@ class List(TestCase):
|
|||
|
||||
self.assertTrue(item.approved)
|
||||
self.assertEqual(item.privacy, "unlisted")
|
||||
self.assertEqual(item.recipients, [self.local_user])
|
||||
self.assertEqual(item.recipients, [])
|
||||
|
||||
def test_list_item_pending(self, _):
|
||||
""" a list entry """
|
||||
|
@ -71,4 +71,4 @@ class List(TestCase):
|
|||
self.assertFalse(item.approved)
|
||||
self.assertEqual(item.book_list.privacy, "public")
|
||||
self.assertEqual(item.privacy, "direct")
|
||||
self.assertEqual(item.recipients, [self.local_user])
|
||||
self.assertEqual(item.recipients, [])
|
||||
|
|
|
@ -53,7 +53,7 @@ services:
|
|||
- 8000:8000
|
||||
redis_activity:
|
||||
image: redis
|
||||
command: redis-server --requirepass ${REDIS_ACTIVITY_PASSWORD}
|
||||
command: redis-server --requirepass ${REDIS_ACTIVITY_PASSWORD} --appendonly yes
|
||||
volumes:
|
||||
- ./redis.conf:/etc/redis/redis.conf
|
||||
env_file: .env
|
||||
|
@ -62,9 +62,11 @@ services:
|
|||
networks:
|
||||
- main
|
||||
restart: on-failure
|
||||
volumes:
|
||||
- redis_activity_data:/data
|
||||
redis_broker:
|
||||
image: redis
|
||||
command: redis-server --requirepass ${REDIS_BROKER_PASSWORD}
|
||||
command: redis-server --requirepass ${REDIS_BROKER_PASSWORD} --appendonly yes
|
||||
volumes:
|
||||
- ./redis.conf:/etc/redis/redis.conf
|
||||
env_file: .env
|
||||
|
@ -73,6 +75,8 @@ services:
|
|||
networks:
|
||||
- main
|
||||
restart: on-failure
|
||||
volumes:
|
||||
- redis_broker_data:/data
|
||||
celery_worker:
|
||||
env_file: .env
|
||||
build: .
|
||||
|
@ -106,5 +110,7 @@ volumes:
|
|||
backups:
|
||||
static_volume:
|
||||
media_volume:
|
||||
redis_broker_data:
|
||||
redis_activity_data:
|
||||
networks:
|
||||
main:
|
||||
|
|
Loading…
Reference in a new issue