diff --git a/bookwyrm/apps.py b/bookwyrm/apps.py index d494877d6..786f86e1c 100644 --- a/bookwyrm/apps.py +++ b/bookwyrm/apps.py @@ -19,11 +19,11 @@ def download_file(url, destination): with open(destination, "b+w") as outfile: outfile.write(stream.read()) except (urllib.error.HTTPError, urllib.error.URLError): - logger.error("Failed to download file %s", url) + logger.info("Failed to download file %s", url) except OSError: - logger.error("Couldn't open font file %s for writing", destination) + logger.info("Couldn't open font file %s for writing", destination) except: # pylint: disable=bare-except - logger.exception("Unknown error in file download") + logger.info("Unknown error in file download") class BookwyrmConfig(AppConfig): diff --git a/bookwyrm/connectors/abstract_connector.py b/bookwyrm/connectors/abstract_connector.py index d8b9c6300..56e273886 100644 --- a/bookwyrm/connectors/abstract_connector.py +++ b/bookwyrm/connectors/abstract_connector.py @@ -131,7 +131,7 @@ class AbstractConnector(AbstractMinimalConnector): try: work_data = self.get_work_from_edition_data(data) except (KeyError, ConnectorException) as err: - logger.exception(err) + logger.info(err) work_data = data if not work_data or not edition_data: @@ -270,7 +270,7 @@ def get_data(url, params=None, timeout=10): timeout=timeout, ) except RequestException as err: - logger.exception(err) + logger.info(err) raise ConnectorException(err) if not resp.ok: @@ -278,7 +278,7 @@ def get_data(url, params=None, timeout=10): try: data = resp.json() except ValueError as err: - logger.exception(err) + logger.info(err) raise ConnectorException(err) return data @@ -296,7 +296,7 @@ def get_image(url, timeout=10): timeout=timeout, ) except RequestException as err: - logger.exception(err) + logger.info(err) return None, None if not resp.ok: @@ -305,7 +305,7 @@ def get_image(url, timeout=10): image_content = ContentFile(resp.content) extension = imghdr.what(None, image_content.read()) if not extension: - logger.exception("File requested was not an image: %s", url) + logger.info("File requested was not an image: %s", url) return None, None return image_content, extension diff --git a/bookwyrm/connectors/connector_manager.py b/bookwyrm/connectors/connector_manager.py index 3bdd5cb41..14bb702cb 100644 --- a/bookwyrm/connectors/connector_manager.py +++ b/bookwyrm/connectors/connector_manager.py @@ -39,7 +39,7 @@ def search(query, min_confidence=0.1, return_first=False): try: result_set = connector.isbn_search(isbn) except Exception as err: # pylint: disable=broad-except - logger.exception(err) + logger.info(err) # if this fails, we can still try regular search # if no isbn search results, we fallback to generic search @@ -48,7 +48,7 @@ def search(query, min_confidence=0.1, return_first=False): result_set = connector.search(query, min_confidence=min_confidence) except Exception as err: # pylint: disable=broad-except # we don't want *any* error to crash the whole search page - logger.exception(err) + logger.info(err) continue if return_first and result_set: diff --git a/bookwyrm/migrations/0145_auto_20220312_1016.py b/bookwyrm/migrations/0145_auto_20220312_1016.py new file mode 100644 index 000000000..58f4bdb79 --- /dev/null +++ b/bookwyrm/migrations/0145_auto_20220312_1016.py @@ -0,0 +1,31 @@ +# Generated by Django 3.2.12 on 2022-03-12 10:16 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("bookwyrm", "0144_alter_announcement_display_type"), + ] + + operations = [ + migrations.AddField( + model_name="inviterequest", + name="answer", + field=models.TextField(default="Foundation by Isaac Azimov", max_length=50), + preserve_default=False, + ), + migrations.AddField( + model_name="sitesettings", + name="invite_question_text", + field=models.CharField( + blank=True, default="What is your favourite book?", max_length=255 + ), + ), + migrations.AddField( + model_name="sitesettings", + name="invite_request_question", + field=models.BooleanField(default=False), + ), + ] diff --git a/bookwyrm/models/site.py b/bookwyrm/models/site.py index c047a05f3..c7e9dbf41 100644 --- a/bookwyrm/models/site.py +++ b/bookwyrm/models/site.py @@ -52,6 +52,8 @@ class SiteSettings(models.Model): require_confirm_email = models.BooleanField(default=True) invite_question_text = models.CharField( + max_length=255, + blank=True, default="What is your favourite book?", max_length=255, # null=False if invite_request_question is False else True, @@ -109,7 +111,11 @@ class SiteSettings(models.Model): """if require_confirm_email is disabled, make sure no users are pending""" if not self.require_confirm_email: User.objects.filter(is_active=False, deactivation_reason="pending").update( - is_active=True, deactivation_reason=None) + is_active=True, deactivation_reason=None + ) + """if invite_request_question is enabled, make sure invite_question_text is not empty""" + if not self.invite_question_text: + self.invite_question_text = "What is your favourite book?" super().save(*args, **kwargs) diff --git a/bookwyrm/templates/author/sync_modal.html b/bookwyrm/templates/author/sync_modal.html index a6e032cbf..44b85ef4e 100644 --- a/bookwyrm/templates/author/sync_modal.html +++ b/bookwyrm/templates/author/sync_modal.html @@ -19,8 +19,10 @@ {% endblock %} {% block modal-footer %} -{% trans "Confirm" %} -{% trans "Cancel" %} +
bookwyrm/static/css/themes
./bw-dev compilescss
bookwym/static/css/themes
./bw-dev compilescsss