From 0afb5bbab1bd714532cc07088973d3004ecb0482 Mon Sep 17 00:00:00 2001
From: dcz <dcz@ipipan.waw.pl>
Date: Thu, 12 Oct 2023 14:53:12 +0200
Subject: [PATCH] Loading entries with lu optimization bugfix

---
 entries/views.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/entries/views.py b/entries/views.py
index 659a18d..ce69c16 100644
--- a/entries/views.py
+++ b/entries/views.py
@@ -423,7 +423,7 @@ def get_entries(request):
             assert(not errors_dict)
         
         linked_ids = set()
-        if request.session['show_linked_entries'] and not with_lexical_units:
+        if request.session['show_linked_entries'] and has_unified_frame != 'true':
             entries_linked = Entry.objects.filter(pk__in=(
                 Entry.objects
                 .filter(subentries__schema_hooks__argument_connections__schema_connections__subentry__entry__in=entries)
@@ -481,7 +481,7 @@ def get_entries(request):
         def iter_lexical_units(e):
             for lu in e.lexical_units.all():
                 lu._frame = lu._frames[0] if lu._frames and len(lu._frames) > 0 else None
-                if lu._frame is None or not hasattr(lu._frame, 'slowal_frame_2_unified_frame'):
+                if lu._frame is None or (not hasattr(lu._frame, 'slowal_frame_2_unified_frame') and has_unified_frame == 'true'):
                     continue
                 else:
                     yield lu
-- 
GitLab