diff --git a/zds/tutorialv2/managers.py b/zds/tutorialv2/managers.py index f510ecc395..5bc72ffcd3 100644 --- a/zds/tutorialv2/managers.py +++ b/zds/tutorialv2/managers.py @@ -55,7 +55,7 @@ def __get_list(self, subcategories=None, tags=None, content_type=None, with_comm FROM tutorialv2_contentreaction,utils_comment WHERE tutorialv2_contentreaction.related_content_id=`tutorialv2_publishablecontent`.`id` AND utils_comment.id=tutorialv2_contentreaction.comment_ptr_id - AND utils_comment.is_visible = TRUE + AND utils_comment.is_visible = 1 """ queryset = queryset.extra(select={"count_note": sub_query}) @@ -237,7 +237,7 @@ def get_last_articles(self, number=0): :return: list of last articles expanded with 'count_note' property that prefetches number of comments :rtype: list """ - sub_query = "SELECT COUNT(*) FROM {} WHERE {}={} AND {}={} AND utils_comment.is_visible=TRUE".format( + sub_query = "SELECT COUNT(*) FROM {} WHERE {}={} AND {}={} AND utils_comment.is_visible=1".format( "tutorialv2_contentreaction,utils_comment", "tutorialv2_contentreaction.related_content_id", "tutorialv2_publishedcontent.content_pk", diff --git a/zds/tutorialv2/views/lists.py b/zds/tutorialv2/views/lists.py index e5b9af6aaa..daceb73385 100644 --- a/zds/tutorialv2/views/lists.py +++ b/zds/tutorialv2/views/lists.py @@ -38,7 +38,7 @@ def get_queryset(self): :return: list of contents with the right type :rtype: list of zds.tutorialv2.models.database.PublishedContent """ - sub_query = "SELECT COUNT(*) FROM {} WHERE {}={} AND {}={} AND utils_comment.is_visible=TRUE".format( + sub_query = "SELECT COUNT(*) FROM {} WHERE {}={} AND {}={} AND utils_comment.is_visible=1".format( "tutorialv2_contentreaction,utils_comment", "tutorialv2_contentreaction.related_content_id", "tutorialv2_publishablecontent.id",