Browse Source

HOT-FIX: Corrige constr de contexto na anex de mat

- Remove a analise de vínculos cíclicos na construção inicial
do form do filterset.
- O item anterior deve resolver o timeout causado na abertura da
anexação em lote, no entanto os timeouts do nginx e gunicorn foram
aumentados.
pull/3465/head
Leandro Roberto 3 years ago
parent
commit
1bbf473e6e
  1. 6
      docker/config/nginx/nginx.conf
  2. 9
      docker/docker-compose.yml
  3. 2
      docker/gunicorn_start.sh
  4. 3
      sapl/materia/forms.py
  5. 3
      sapl/materia/views.py

6
docker/config/nginx/nginx.conf

@ -23,7 +23,11 @@ http {
sendfile off; sendfile off;
#tcp_nopush on; #tcp_nopush on;
keepalive_timeout 65; keepalive_timeout 300;
proxy_connect_timeout 75s;
proxy_read_timeout 300s;
gzip on; gzip on;
gzip_disable "MSIE [1-6]\\.(?!.*SV1)"; gzip_disable "MSIE [1-6]\\.(?!.*SV1)";

9
docker/docker-compose.yml

@ -32,15 +32,16 @@ services:
networks: networks:
- sapl-net - sapl-net
sapl: sapl:
image: interlegis/sapl:3.1.162-RC11 #image: interlegis/sapl:3.1.162-RC11
# build: build:
# context: ../ context: ../
# dockerfile: ./docker/Dockerfile dockerfile: ./docker/Dockerfile
container_name: sapl container_name: sapl
labels: labels:
NAME: "sapl" NAME: "sapl"
restart: always restart: always
environment: environment:
LOGGING_CONSOLE_VERBOSE: 'True'
ADMIN_PASSWORD: interlegis ADMIN_PASSWORD: interlegis
ADMIN_EMAIL: email@dominio.net ADMIN_EMAIL: email@dominio.net
DEBUG: 'False' DEBUG: 'False'

2
docker/gunicorn_start.sh

@ -25,7 +25,7 @@ USER=`whoami` # the user to run as (*)
GROUP=`whoami` # the group to run as (*) GROUP=`whoami` # the group to run as (*)
NUM_WORKERS=3 # how many worker processes should Gunicorn spawn (*) NUM_WORKERS=3 # how many worker processes should Gunicorn spawn (*)
# NUM_WORKERS = 2 * CPUS + 1 # NUM_WORKERS = 2 * CPUS + 1
TIMEOUT=60 TIMEOUT=300
MAX_REQUESTS=100 # number of requests before restarting worker MAX_REQUESTS=100 # number of requests before restarting worker
DJANGO_SETTINGS_MODULE=sapl.settings # which settings file should Django use (*) DJANGO_SETTINGS_MODULE=sapl.settings # which settings file should Django use (*)
DJANGO_WSGI_MODULE=sapl.wsgi # WSGI module name (*) DJANGO_WSGI_MODULE=sapl.wsgi # WSGI module name (*)

3
sapl/materia/forms.py

@ -1416,6 +1416,9 @@ class AnexadaEmLoteFilterSet(django_filters.FilterSet):
self.filters['tipo'].label = 'Tipo de Matéria' self.filters['tipo'].label = 'Tipo de Matéria'
self.filters['data_apresentacao'].label = 'Data (Inicial - Final)' self.filters['data_apresentacao'].label = 'Data (Inicial - Final)'
self.form.fields['tipo'].required = True
self.form.fields['data_apresentacao'].required = True
row1 = to_row([('tipo', 12)]) row1 = to_row([('tipo', 12)])
row2 = to_row([('data_apresentacao', 12)]) row2 = to_row([('data_apresentacao', 12)])

3
sapl/materia/views.py

@ -2385,6 +2385,9 @@ class MateriaAnexadaEmLoteView(PermissionRequiredMixin, FilterView):
return context return context
qr = self.request.GET.copy() qr = self.request.GET.copy()
if not len(qr):
context['object_list'] = []
else:
context['object_list'] = context['object_list'].order_by( context['object_list'] = context['object_list'].order_by(
'numero', '-ano') 'numero', '-ano')
principal = MateriaLegislativa.objects.get(pk=self.kwargs['pk']) principal = MateriaLegislativa.objects.get(pk=self.kwargs['pk'])

Loading…
Cancel
Save