From 12cc839de0415a4a33fd4c3f8de5607b7bca1297 Mon Sep 17 00:00:00 2001 From: Johnatan Chaves Ribeiro Date: Tue, 26 Oct 2021 08:30:25 -0300 Subject: [PATCH 1/2] delete commented code clean file deleting commented code --- DjangoBlog/elasticsearch_backend.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/DjangoBlog/elasticsearch_backend.py b/DjangoBlog/elasticsearch_backend.py index fa23e0f..c4ee3e3 100644 --- a/DjangoBlog/elasticsearch_backend.py +++ b/DjangoBlog/elasticsearch_backend.py @@ -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( From 3fe9789239018b30728c2a4825fa8f471fa5fd54 Mon Sep 17 00:00:00 2001 From: liangliangyy Date: Fri, 12 Nov 2021 10:25:22 +0800 Subject: [PATCH 2/2] fix #518 --- templates/blog/tags/article_info.html | 2 +- templates/blog/tags/sidebar.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/blog/tags/article_info.html b/templates/blog/tags/article_info.html index 25058af..54883ce 100644 --- a/templates/blog/tags/article_info.html +++ b/templates/blog/tags/article_info.html @@ -23,7 +23,7 @@ - {% if article.comment and article.comment_set.count %} + {% if article.comment_set and article.comment_set.count %} {{ article.comment_set.count }}个评论 {% else %} 发表评论 diff --git a/templates/blog/tags/sidebar.html b/templates/blog/tags/sidebar.html index 806a53f..c2de415 100755 --- a/templates/blog/tags/sidebar.html +++ b/templates/blog/tags/sidebar.html @@ -122,7 +122,7 @@ {% else %} -
  • 登录 +
  • 登录
  • {% endif %} {% if user.is_superuser %}
  • 刷新缓存