From 363f358a0876c683a7c7555bbb69955bd89e1451 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 20 Feb 2022 11:50:24 -0500 Subject: [PATCH] enable anonymous search --- common/templates/common/search_result.html | 2 +- common/views.py | 2 -- mastodon/models.py | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/common/templates/common/search_result.html b/common/templates/common/search_result.html index 4f73bbc9..f7ff701b 100644 --- a/common/templates/common/search_result.html +++ b/common/templates/common/search_result.html @@ -50,7 +50,7 @@ {% trans '无站内条目匹配' %} {% endfor %} - {% if request.GET.q %} + {% if request.GET.q and user.is_authenticated %}
  • {% trans '正在实时搜索站外条目' %}
  • diff --git a/common/views.py b/common/views.py index 885be39c..0d331536 100644 --- a/common/views.py +++ b/common/views.py @@ -51,7 +51,6 @@ def external_search(request): ) -@login_required def search(request): if settings.SEARCH_BACKEND is None: return search2(request) @@ -91,7 +90,6 @@ def search(request): ) -@login_required def search2(request): if request.method == 'GET': diff --git a/mastodon/models.py b/mastodon/models.py index 138b5f43..67aec03f 100644 --- a/mastodon/models.py +++ b/mastodon/models.py @@ -5,7 +5,7 @@ from django.utils.translation import gettext_lazy as _ class MastodonApplication(models.Model): domain_name = models.CharField(_('site domain name'), max_length=100, unique=True) - app_id = models.PositiveIntegerField(_('in-site app id')) + app_id = models.PositiveIntegerField(_('in-site app id')) # TODO Remove? bc 1) it seems useless 2) GoToSocial returns a hash text id client_id = models.CharField(_('client id'), max_length=100) client_secret = models.CharField(_('client secret'), max_length=100) vapid_key = models.CharField(_('vapid key'), max_length=200)