Browse Source

Fix sql query for sqlite: list of id must be a list of id, no list of tuple containig id

Bastien Sevajol (Algoo) 8 years ago
parent
commit
8586ad7667
1 changed files with 9 additions and 2 deletions
  1. 9 2
      tracim/tracim/lib/content.py

+ 9 - 2
tracim/tracim/lib/content.py View File

@@ -1,4 +1,6 @@
1 1
 # -*- coding: utf-8 -*-
2
+from operator import itemgetter
3
+
2 4
 __author__ = 'damien'
3 5
 
4 6
 import datetime
@@ -556,8 +558,13 @@ class ContentApi(object):
556 558
             .filter(~ContentRevisionRO.revision_id.in_(read_revision_ids)) \
557 559
             .subquery()
558 560
 
559
-        not_read_content_ids = DBSession.query(
560
-            distinct(not_read_revisions.c.content_id)).all()
561
+        not_read_content_ids_query = DBSession.query(
562
+            distinct(not_read_revisions.c.content_id)
563
+        )
564
+        not_read_content_ids = list(map(
565
+            itemgetter(0),
566
+            not_read_content_ids_query,
567
+        ))
561 568
 
562 569
         not_read_contents = self._base_query(workspace) \
563 570
             .filter(Content.content_id.in_(not_read_content_ids)) \