Browse Source

Otimizacao de codigo de autorizacao em recibo de proposicao

pull/579/head
Eduardo Calil 8 years ago
parent
commit
ee2e0b38db
  1. 13
      sapl/materia/views.py

13
sapl/materia/views.py

@ -541,16 +541,13 @@ class ReciboProposicaoView(TemplateView):
def has_permission(self):
perms = self.get_permission_required()
if self.request.user.has_perms(perms):
if (Proposicao.objects.filter(
id=self.kwargs['pk'],
autor__user_id=self.request.user.id).exists()):
return True
else:
return False
else:
if not self.request.user.has_perms(perms):
return False
return (Proposicao.objects.filter(
id=self.kwargs['pk'],
autor__user_id=self.request.user.id).exists())
def get_context_data(self, **kwargs):
context = super(ReciboProposicaoView, self).get_context_data(
**kwargs)

Loading…
Cancel
Save