From bf906799f6bfea6443abc8ff58265d65501df0b9 Mon Sep 17 00:00:00 2001 From: Cesar Augusto de Carvalho Date: Wed, 24 Oct 2018 16:55:50 -0300 Subject: [PATCH] FIX #2328 (#2329) * problema na contagem de documentos administrativos resolvido * FIX #2328 --- sapl/protocoloadm/views.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sapl/protocoloadm/views.py b/sapl/protocoloadm/views.py index 84280796f..7ba286592 100644 --- a/sapl/protocoloadm/views.py +++ b/sapl/protocoloadm/views.py @@ -771,8 +771,14 @@ class PesquisarDocumentoAdministrativoView(DocumentoAdministrativoMixin, url = '' self.filterset.form.fields['o'].label = _('Ordenação') - - length = self.object_list.count() + + # é usada essa verificação anônima para quando os documentos administrativos + # estão no modo ostensivo, mas podem existir documentos administrativos restritos + if request.user.is_anonymous(): + length = self.object_list.filter(restrito=False).count() + else: + length = self.object_list.count() + context = self.get_context_data(filter=self.filterset, filter_url=url, numero_res=length