Merge pull request #519 from liangliangyy/dev

fix bugs
pull/12/head
且听风吟 4 years ago committed by GitHub
commit 7b073d01a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -35,10 +35,6 @@ class ElasticSearchBackend(BaseSearchBackend):
connection_alias,
**connection_options)
self.manager = ArticleDocumentManager()
# try:
# self._rebuild(None)
# except:
# pass
def _get_models(self, iterable):
models = iterable if iterable and iterable[0] else Article.objects.all()
@ -96,9 +92,6 @@ class ElasticSearchBackend(BaseSearchBackend):
model_name = 'Article'
additional_fields = {}
# if 'highlight' in raw_result:
# additional_fields['highlighted'] = raw_result['highlight'].get(content_field, '')
result_class = SearchResult
result = result_class(

@ -23,7 +23,7 @@
<a href="{{ article.get_absolute_url }}#comments" class="ds-thread-count" data-thread-key="3815"
rel="nofollow">
<span class="leave-reply">
{% if article.comment and article.comment_set.count %}
{% if article.comment_set and article.comment_set.count %}
{{ article.comment_set.count }}个评论
{% else %}
发表评论

@ -122,7 +122,7 @@
</li>
{% else %}
<li><a href="{% url "account:login" %}" rel="nofollow">登录</a>
<li><a href="{% url "account:login" %}" rel="nofollow">登录</a></li>
{% endif %}
{% if user.is_superuser %}
<li><a href="{% url "blog:refresh" %}" target="_blank">刷新缓存</a></li>

Loading…
Cancel
Save