enable anonymous search

This commit is contained in:
Your Name 2022-02-20 11:50:24 -05:00
parent f9b899ed0a
commit 363f358a08
3 changed files with 2 additions and 4 deletions

View file

@ -50,7 +50,7 @@
{% trans '无站内条目匹配' %}
</li>
{% endfor %}
{% if request.GET.q %}
{% if request.GET.q and user.is_authenticated %}
<li class="entity-list__entity" hx-get="{% url 'common:external_search' %}?q={{ request.GET.q }}&c={{ request.GET.c }}&page={% if pagination.current_page %}{{ pagination.current_page }}{% else %}1{% endif %}" hx-trigger="revealed" hx-swap="outerHTML">
{% trans '正在实时搜索站外条目' %}
</li>

View file

@ -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':

View file

@ -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)