diff --git a/bookwyrm/connectors/connector_manager.py b/bookwyrm/connectors/connector_manager.py index 1c938b4b6..43489669b 100644 --- a/bookwyrm/connectors/connector_manager.py +++ b/bookwyrm/connectors/connector_manager.py @@ -40,7 +40,7 @@ def search(query, min_confidence=0.1, return_first=False): # if this fails, we can still try regular search # if no isbn search results, we fallback to generic search - if result_set in (None, []): + if not result_set: try: result_set = connector.search(query, min_confidence=min_confidence) except Exception as e: # pylint: disable=broad-except @@ -52,12 +52,13 @@ def search(query, min_confidence=0.1, return_first=False): # if we found anything, return it return result_set[0] - results.append( - { - "connector": connector, - "results": result_set, - } - ) + if result_set or connector.local: + results.append( + { + "connector": connector, + "results": result_set, + } + ) if return_first: return None diff --git a/bookwyrm/settings.py b/bookwyrm/settings.py index 1bc3c587b..45d8cb9d6 100644 --- a/bookwyrm/settings.py +++ b/bookwyrm/settings.py @@ -38,7 +38,7 @@ LOCALE_PATHS = [ DEFAULT_AUTO_FIELD = "django.db.models.AutoField" # Quick-start development settings - unsuitable for production -# See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/ +# See https://docs.djangoproject.com/en/3.2/howto/deployment/checklist/ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = env("SECRET_KEY") @@ -107,7 +107,7 @@ MAX_STREAM_LENGTH = int(env("MAX_STREAM_LENGTH", 200)) STREAMS = ["home", "local", "federated"] # Database -# https://docs.djangoproject.com/en/2.0/ref/settings/#databases +# https://docs.djangoproject.com/en/3.2/ref/settings/#databases BOOKWYRM_DATABASE_BACKEND = env("BOOKWYRM_DATABASE_BACKEND", "postgres") @@ -129,7 +129,7 @@ LOGIN_URL = "/login/" AUTH_USER_MODEL = "bookwyrm.User" # Password validation -# https://docs.djangoproject.com/en/2.0/ref/settings/#auth-password-validators +# https://docs.djangoproject.com/en/3.2/ref/settings/#auth-password-validators AUTH_PASSWORD_VALIDATORS = [ { @@ -148,7 +148,7 @@ AUTH_PASSWORD_VALIDATORS = [ # Internationalization -# https://docs.djangoproject.com/en/2.0/topics/i18n/ +# https://docs.djangoproject.com/en/3.2/topics/i18n/ LANGUAGE_CODE = "en-us" LANGUAGES = [ @@ -170,7 +170,7 @@ USE_TZ = True # Static files (CSS, JavaScript, Images) -# https://docs.djangoproject.com/en/3.1/howto/static-files/ +# https://docs.djangoproject.com/en/3.2/howto/static-files/ PROJECT_DIR = os.path.dirname(os.path.abspath(__file__)) STATIC_URL = "/static/" diff --git a/bookwyrm/templates/search/book.html b/bookwyrm/templates/search/book.html index 84c2fafea..9af8a3943 100644 --- a/bookwyrm/templates/search/book.html +++ b/bookwyrm/templates/search/book.html @@ -27,8 +27,10 @@
- {% trans "Show" as button_text %} - {% include 'snippets/toggle/open_button.html' with text=button_text small=True controls_text="more-results-panel" controls_uid=result_set.connector.identifier class="is-small" icon="arrow-down" pressed=forloop.first %} + {% trans "Open" as button_text %} + {% include 'snippets/toggle/open_button.html' with text=button_text small=True controls_text="more-results-panel" controls_uid=result_set.connector.identifier class="is-small" icon_with_text="arrow-down" pressed=forloop.first %} + {% trans "Close" as button_text %} + {% include 'snippets/toggle/close_button.html' with text=button_text small=True controls_text="more-results-panel" controls_uid=result_set.connector.identifier class="is-small" icon_with_text="arrow-up" pressed=forloop.first %}
{% endif %} @@ -36,8 +38,6 @@
- {% trans "Close" as button_text %} - {% include 'snippets/toggle/toggle_button.html' with label=button_text class="delete" nonbutton=True controls_text="more-results-panel" controls_uid=result_set.connector.identifier pressed=forloop.first %}