Browse Source

Fix: ContentApi.get_one_by_label_and_parent: content_parent is None case

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

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

@@ -416,7 +416,8 @@ class ContentApi(object):
416 416
         :param workspace: The workspace's content
417 417
         :return The corresponding Content
418 418
         """
419
-        query = self._base_query(content_parent.workspace)
419
+        workspace = content_parent.workspace if content_parent else None
420
+        query = self._base_query(workspace)
420 421
         parent_id = content_parent.content_id if content_parent else None
421 422
         query = query.filter(Content.parent_id == parent_id)
422 423