From 1a33f87eaeb5bd181b67b7be86dbde8223b84dc0 Mon Sep 17 00:00:00 2001 From: LeandroRoberto Date: Tue, 8 Nov 2016 10:28:37 -0200 Subject: [PATCH] Fix #786 --- sapl/compilacao/models.py | 2 +- sapl/crispy_layout_mixin.py | 5 +-- sapl/crud/base.py | 7 ++-- sapl/parlamentares/views.py | 35 ++++++++++++++++++- .../compilacao/textoarticulado_detail.html | 4 ++- sapl/templates/crud/detail.html | 9 +++++ sapl/templates/crud/detail_detail.html | 11 ++++++ sapl/templates/materia/proposicao_detail.html | 1 - 8 files changed, 63 insertions(+), 11 deletions(-) diff --git a/sapl/compilacao/models.py b/sapl/compilacao/models.py index 1531e6542..6752a82c1 100644 --- a/sapl/compilacao/models.py +++ b/sapl/compilacao/models.py @@ -210,7 +210,7 @@ class TextoArticulado(TimestampedMixin): if request.user in self.owners.all(): return True - if self.privacidade == STATUS_TA_RESTRICT and\ + if self.privacidade == STATUS_TA_IMMUTABLE_RESTRICT and\ request.user.has_perm( 'compilacao.view_restricted_textoarticulado'): return True diff --git a/sapl/crispy_layout_mixin.py b/sapl/crispy_layout_mixin.py index 34c9ecab4..028301502 100644 --- a/sapl/crispy_layout_mixin.py +++ b/sapl/crispy_layout_mixin.py @@ -1,12 +1,12 @@ from math import ceil -import rtyaml from crispy_forms.bootstrap import FormActions from crispy_forms.helper import FormHelper from crispy_forms.layout import HTML, Div, Fieldset, Layout, Submit from django import template from django.utils import formats from django.utils.translation import ugettext as _ +import rtyaml def heads_and_tails(list_of_lists): @@ -91,7 +91,8 @@ def get_field_display(obj, fieldname): else: display = '' elif 'ManyRelatedManager' in str(type(value))\ - or 'RelatedManager' in str(type(value)): + or 'RelatedManager' in str(type(value))\ + or 'GenericRelatedObjectManager' in str(type(value)): display = '