Heitor
4 days ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
4 additions and
3 deletions
-
sapl/audiencia/forms.py
-
sapl/utils.py
|
|
|
@ -115,7 +115,7 @@ class AudienciaForm(FileFieldCheckMixin, forms.ModelForm): |
|
|
|
numero=materia, |
|
|
|
ano=ano_materia, |
|
|
|
tipo=tipo_materia) |
|
|
|
except ObjectDoesNotExist: |
|
|
|
except (ObjectDoesNotExist, ValueError): |
|
|
|
msg = _('A matéria %s nº %s/%s não existe no cadastro' |
|
|
|
' de matérias legislativas.' % (tipo_materia, materia, ano_materia)) |
|
|
|
self.logger.warning( |
|
|
|
|
|
|
|
@ -1395,8 +1395,9 @@ class MultiFormatOutputMixin: |
|
|
|
return {fmt: fields for fmt in self.formats_impl} |
|
|
|
|
|
|
|
def render_to_response(self, context, **response_kwargs): |
|
|
|
format_result = getattr(self.request, self.request.method).get( |
|
|
|
'format', None) |
|
|
|
# HEAD shares query params with GET; Django has no request.HEAD attribute. |
|
|
|
_method = 'GET' if self.request.method == 'HEAD' else self.request.method |
|
|
|
format_result = getattr(self.request, _method).get('format', None) |
|
|
|
|
|
|
|
if format_result: |
|
|
|
if format_result not in self.formats_impl: |
|
|
|
|