diff --git a/README.md b/README.md
index 558d42d45..f8b2eb1f6 100644
--- a/README.md
+++ b/README.md
@@ -37,7 +37,7 @@ Keep track of what books you've read, and what books you'd like to read in the f
Federation allows you to interact with users on other instances and services, and also shares metadata about books and authors, which collaboratively builds a decentralized database of books.
### Privacy and moderation
-Users and administrators can control who can see thier posts and what other instances to federate with.
+Users and administrators can control who can see their posts and what other instances to federate with.
## Tech Stack
Web backend
diff --git a/bookwyrm/activitypub/base_activity.py b/bookwyrm/activitypub/base_activity.py
index e942c9aeb..fa845f124 100644
--- a/bookwyrm/activitypub/base_activity.py
+++ b/bookwyrm/activitypub/base_activity.py
@@ -271,7 +271,7 @@ def resolve_remote_id(
try:
data = get_data(remote_id)
except ConnectorException:
- logger.exception("Could not connect to host for remote_id: %s", remote_id)
+ logger.info("Could not connect to host for remote_id: %s", remote_id)
return None
# determine the model implicitly, if not provided
diff --git a/bookwyrm/connectors/abstract_connector.py b/bookwyrm/connectors/abstract_connector.py
index c1ee7fe78..8ae93926a 100644
--- a/bookwyrm/connectors/abstract_connector.py
+++ b/bookwyrm/connectors/abstract_connector.py
@@ -222,7 +222,7 @@ def dict_from_mappings(data, mappings):
return result
-def get_data(url, params=None, timeout=10):
+def get_data(url, params=None, timeout=settings.QUERY_TIMEOUT):
"""wrapper for request.get"""
# check if the url is blocked
raise_not_valid_url(url)
diff --git a/bookwyrm/migrations/0166_sitesettings_imports_enabled.py b/bookwyrm/migrations/0166_sitesettings_imports_enabled.py
new file mode 100644
index 000000000..ccf4ef374
--- /dev/null
+++ b/bookwyrm/migrations/0166_sitesettings_imports_enabled.py
@@ -0,0 +1,18 @@
+# Generated by Django 3.2.16 on 2022-11-17 21:50
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("bookwyrm", "0165_alter_inviterequest_answer"),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name="sitesettings",
+ name="imports_enabled",
+ field=models.BooleanField(default=True),
+ ),
+ ]
diff --git a/bookwyrm/models/site.py b/bookwyrm/models/site.py
index 3c1494204..9e97ede9a 100644
--- a/bookwyrm/models/site.py
+++ b/bookwyrm/models/site.py
@@ -86,6 +86,9 @@ class SiteSettings(SiteModel):
admin_email = models.EmailField(max_length=255, null=True, blank=True)
footer_item = models.TextField(null=True, blank=True)
+ # controls
+ imports_enabled = models.BooleanField(default=True)
+
field_tracker = FieldTracker(fields=["name", "instance_tagline", "logo"])
@classmethod
diff --git a/bookwyrm/models/user.py b/bookwyrm/models/user.py
index 5f7b00d87..e48d86572 100644
--- a/bookwyrm/models/user.py
+++ b/bookwyrm/models/user.py
@@ -244,9 +244,10 @@ class User(OrderedCollectionPageMixin, AbstractUser):
def admins(cls):
"""Get a queryset of the admins for this instance"""
return cls.objects.filter(
- models.Q(user_permissions__name__in=["moderate_user", "moderate_post"])
- | models.Q(is_superuser=True)
- )
+ models.Q(groups__name__in=["moderator", "admin"])
+ | models.Q(is_superuser=True),
+ is_active=True,
+ ).distinct()
def update_active_date(self):
"""this user is here! they are doing things!"""
diff --git a/bookwyrm/settings.py b/bookwyrm/settings.py
index 1f9cd87ed..0fcc00590 100644
--- a/bookwyrm/settings.py
+++ b/bookwyrm/settings.py
@@ -11,7 +11,7 @@ from django.utils.translation import gettext_lazy as _
env = Env()
env.read_env()
DOMAIN = env("DOMAIN")
-VERSION = "0.4.6"
+VERSION = "0.5.1"
RELEASE_API = env(
"RELEASE_API",
diff --git a/bookwyrm/static/css/themes/bookwyrm-dark.scss b/bookwyrm/static/css/themes/bookwyrm-dark.scss
index a2eb94efb..b98422688 100644
--- a/bookwyrm/static/css/themes/bookwyrm-dark.scss
+++ b/bookwyrm/static/css/themes/bookwyrm-dark.scss
@@ -92,6 +92,10 @@ $family-secondary: $family-sans-serif;
color: $grey-light !important;
}
+#qrcode svg {
+ background-color: #a6a6a6;
+}
+
@import "../bookwyrm.scss";
@import "../vendor/icons.css";
@import "../vendor/shepherd.scss";
diff --git a/bookwyrm/templates/about/about.html b/bookwyrm/templates/about/about.html
index 481ecda99..c446e0cf2 100644
--- a/bookwyrm/templates/about/about.html
+++ b/bookwyrm/templates/about/about.html
@@ -11,7 +11,7 @@
{% block about_content %}
{# seven day cache #}
-{% cache 604800 about_page %}
+{% cache 604800 about_page_superlatives %}
{% get_book_superlatives as superlatives %}
- {% if recent_avg_hours %} - {% blocktrans trimmed with hours=recent_avg_hours|floatformat:0|intcomma %} - On average, recent imports have taken {{ hours }} hours. - {% endblocktrans %} - {% else %} - {% blocktrans trimmed with minutes=recent_avg_minutes|floatformat:0|intcomma %} - On average, recent imports have taken {{ minutes }} minutes. - {% endblocktrans %} + {% if site.imports_enabled %} + {% if recent_avg_hours or recent_avg_minutes %} +
+ {% if recent_avg_hours %} + {% blocktrans trimmed with hours=recent_avg_hours|floatformat:0|intcomma %} + On average, recent imports have taken {{ hours }} hours. + {% endblocktrans %} + {% else %} + {% blocktrans trimmed with minutes=recent_avg_minutes|floatformat:0|intcomma %} + On average, recent imports have taken {{ minutes }} minutes. + {% endblocktrans %} + {% endif %} +
++ +
++ {% trans "Imports are temporarily disabled; thank you for your patience." %}
{% trans "Scan the QR code with your authentication app and then enter the code from your app below to confirm your app is set up." %}
- {% trans "Code of Conduct" %} + {% trans "Code of Conduct" %}
{% trans "Privacy Policy" %} diff --git a/bookwyrm/templates/user/user.html b/bookwyrm/templates/user/user.html index 8e61d525d..d67f42fc3 100755 --- a/bookwyrm/templates/user/user.html +++ b/bookwyrm/templates/user/user.html @@ -64,12 +64,14 @@