Selaa lähdekoodia

WebDAV: fix: get contents from path: no parent is no parent in SQL

Bastien Sevajol (Algoo) 8 vuotta sitten
vanhempi
commit
501ffb9d74
1 muutettua tiedostoa jossa 7 lisäystä ja 0 poistoa
  1. 7 0
      tracim/tracim/lib/content.py

+ 7 - 0
tracim/tracim/lib/content.py Näytä tiedosto

496
             content_query = content_query.filter(
496
             content_query = content_query.filter(
497
                 Content.parent_id == parent_folder.content_id,
497
                 Content.parent_id == parent_folder.content_id,
498
             )
498
             )
499
+        else:
500
+            content_query = content_query.filter(
501
+                Content.parent_id == None,
502
+            )
499
 
503
 
500
         # Filter with workspace
504
         # Filter with workspace
501
         content_query = content_query.filter(
505
         content_query = content_query.filter(
541
                     .filter(
545
                     .filter(
542
                         Content.parent_id == folder.content_id,
546
                         Content.parent_id == folder.content_id,
543
                     )
547
                     )
548
+            else:
549
+                folder_query = folder_query \
550
+                    .filter(Content.parent_id == None)
544
 
551
 
545
             # Get thirst corresponding folder
552
             # Get thirst corresponding folder
546
             folder = folder_query \
553
             folder = folder_query \