diff --git a/books/templates/books/create_update.html b/books/templates/books/create_update.html index b9d0882c..339c70e5 100644 --- a/books/templates/books/create_update.html +++ b/books/templates/books/create_update.html @@ -9,7 +9,7 @@ - + {% trans 'Boofilsic - ' %}{{ title }} @@ -50,7 +50,7 @@ diff --git a/books/templates/books/create_update_review.html b/books/templates/books/create_update_review.html index c19e72db..815ee058 100644 --- a/books/templates/books/create_update_review.html +++ b/books/templates/books/create_update_review.html @@ -9,7 +9,7 @@ - + {% trans 'Boofilsic - ' %}{{ title }} @@ -100,11 +100,10 @@ - {% comment %} diff --git a/books/templates/books/delete.html b/books/templates/books/delete.html index f5ac6bfb..746d906c 100644 --- a/books/templates/books/delete.html +++ b/books/templates/books/delete.html @@ -9,7 +9,7 @@ - + {% trans 'Boofilsic - 删除图书' %} @@ -79,7 +79,7 @@ diff --git a/books/templates/books/delete_review.html b/books/templates/books/delete_review.html index e3d8404b..da915329 100644 --- a/books/templates/books/delete_review.html +++ b/books/templates/books/delete_review.html @@ -9,7 +9,7 @@ - + {% trans 'Boofilsic - 删除评论' %} @@ -79,7 +79,7 @@ diff --git a/books/templates/books/detail.html b/books/templates/books/detail.html index ce64005b..af6fa63d 100644 --- a/books/templates/books/detail.html +++ b/books/templates/books/detail.html @@ -9,7 +9,7 @@ - + {% trans 'Boofilsic - 书籍详情' %} | {{ book.title }} @@ -250,7 +250,7 @@ diff --git a/books/templates/books/mark_list.html b/books/templates/books/mark_list.html index 4caf82ca..9f1a2565 100644 --- a/books/templates/books/mark_list.html +++ b/books/templates/books/mark_list.html @@ -10,7 +10,7 @@ - + {% trans 'Boofilsic - 搜索结果' %} @@ -140,7 +140,7 @@ diff --git a/books/templates/books/review_detail.html b/books/templates/books/review_detail.html index a1ebbf4b..2d4ffd1d 100644 --- a/books/templates/books/review_detail.html +++ b/books/templates/books/review_detail.html @@ -9,7 +9,7 @@ - + {% trans 'Boofilsic - 查看评论' %} @@ -104,7 +104,7 @@ diff --git a/books/templates/books/review_list.html b/books/templates/books/review_list.html index 811b1522..edaca580 100644 --- a/books/templates/books/review_list.html +++ b/books/templates/books/review_list.html @@ -10,7 +10,7 @@ - + {% trans 'Boofilsic - 搜索结果' %} @@ -135,7 +135,7 @@ diff --git a/books/templates/books/scrape.html b/books/templates/books/scrape.html index 67f0e9f3..f65e919f 100644 --- a/books/templates/books/scrape.html +++ b/books/templates/books/scrape.html @@ -9,7 +9,7 @@ - + {% trans 'Boofilsic - 主页' %} @@ -71,7 +71,7 @@ diff --git a/common/models.py b/common/models.py index a9df779f..645beed3 100644 --- a/common/models.py +++ b/common/models.py @@ -100,18 +100,18 @@ class UserOwnedEntity(models.Model): # this is guaranteed by models id_list = [e.owner.mastodon_id for e in user_owned_entities] # Mastodon request - # relationships = get_relationships(id_list, token) - # mute_block_blocked = [] - # following = [] - # for r in relationships: - # # check json data type - # if r['blocking'] or r['blocked_by'] or r['muting']: - # mute_block_blocked.append(r['id']) - # if r['following']: - # following.append(r['id']) - # user_owned_entities = user_owned_entities.exclude(owner__mastodon_id__in=mute_block_blocked) - # following.append(str(user.mastodon_id)) - # user_owned_entities = user_owned_entities.exclude(Q(is_private=True) & ~Q(owner__mastodon_id__in=following)) + relationships = get_relationships(id_list, token) + mute_block_blocked = [] + following = [] + for r in relationships: + # check json data type + if r['blocking'] or r['blocked_by'] or r['muting']: + mute_block_blocked.append(r['id']) + if r['following']: + following.append(r['id']) + user_owned_entities = user_owned_entities.exclude(owner__mastodon_id__in=mute_block_blocked) + following.append(str(user.mastodon_id)) + user_owned_entities = user_owned_entities.exclude(Q(is_private=True) & ~Q(owner__mastodon_id__in=following)) return user_owned_entities diff --git a/common/templates/common/error.html b/common/templates/common/error.html index e627d2ff..9025eb5f 100644 --- a/common/templates/common/error.html +++ b/common/templates/common/error.html @@ -4,7 +4,7 @@ - + diff --git a/common/templates/common/home.html b/common/templates/common/home.html index a4b97ad3..5eca3bab 100644 --- a/common/templates/common/home.html +++ b/common/templates/common/home.html @@ -9,7 +9,7 @@ - + {% trans 'Boofilsic - 主页' %} @@ -168,7 +168,7 @@ diff --git a/common/templates/common/search_result.html b/common/templates/common/search_result.html index 13c33adb..acd5e53d 100644 --- a/common/templates/common/search_result.html +++ b/common/templates/common/search_result.html @@ -10,7 +10,7 @@ - + {% trans 'Boofilsic - 搜索结果' %} @@ -165,7 +165,7 @@ diff --git a/users/templates/users/list.html b/users/templates/users/list.html index 0ddc14b3..644abe1c 100644 --- a/users/templates/users/list.html +++ b/users/templates/users/list.html @@ -10,7 +10,7 @@ - + {% trans 'Boofilsic - 书' %} @@ -192,7 +192,7 @@ diff --git a/users/templates/users/login.html b/users/templates/users/login.html index 5855da56..670c1a95 100644 --- a/users/templates/users/login.html +++ b/users/templates/users/login.html @@ -5,7 +5,7 @@ - + diff --git a/users/templates/users/manage_report.html b/users/templates/users/manage_report.html index e7117423..cd85f62e 100644 --- a/users/templates/users/manage_report.html +++ b/users/templates/users/manage_report.html @@ -9,7 +9,7 @@ - + {% trans 'Boofilsic - 管理举报' %} @@ -61,7 +61,7 @@ diff --git a/users/templates/users/register.html b/users/templates/users/register.html index c1ca096a..87f965e3 100644 --- a/users/templates/users/register.html +++ b/users/templates/users/register.html @@ -5,7 +5,7 @@ - + diff --git a/users/templates/users/report.html b/users/templates/users/report.html index 03d3c2fd..10630b59 100644 --- a/users/templates/users/report.html +++ b/users/templates/users/report.html @@ -9,7 +9,7 @@ - + {% trans 'Boofilsic - 举报用户' %} @@ -50,7 +50,7 @@