mirror of https://github.com/interlegis/sapl.git
Browse Source
RelatorioNormasPorAutorFilterSet: chaining .filter(autorianorma__primeiro_autor=True) after the filterset's own autorianorma__autor filter created a second JOIN, causing each norma to appear once per Autoria with primeiro_autor=True. Removing that filter leaves a single JOIN so DISTINCT works correctly. Both filtersets now return none() when no author is selected, preventing a full-table scan with an unguarded ORDER BY on a related field. Both views pass the Autor object (not str) into context so the templates can compare autoria.autor != autor by PK. Both templates now show only co-authors (those different from the filtered author) in the Coautor(es) column, mirroring each other. RelatorioMateriasPorAutorView: removed the OrderedDict.fromkeys() deduplication workaround that was masking the same underlying JOIN issue. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>3.1.x
4 changed files with 18 additions and 19 deletions
Loading…
Reference in new issue