Browse Source

Adiciona @transaction.atomic em form_valid de protocolo

pull/2894/head
Edward Ribeiro 6 years ago
committed by João
parent
commit
fd4d588132
  1. 3
      sapl/protocoloadm/views.py

3
sapl/protocoloadm/views.py

@ -11,6 +11,7 @@ from django.contrib.auth.mixins import PermissionRequiredMixin
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import reverse
from django.db import transaction
from django.db.models import Max, Q
from django.http import Http404, HttpResponse, JsonResponse
from django.http.response import HttpResponseRedirect
@ -539,6 +540,7 @@ class ProtocoloDocumentoView(PermissionRequiredMixin,
initial['hora'] = timezone.localtime(timezone.now())
return initial
@transaction.atomic
def form_valid(self, form):
protocolo = form.save(commit=False)
username = self.request.user.username
@ -726,6 +728,7 @@ class ProtocoloMateriaView(PermissionRequiredMixin, CreateView):
initial['hora'] = timezone.localtime(timezone.now())
return initial
@transaction.atomic
def form_valid(self, form):
protocolo = form.save(commit=False)
username = self.request.user.username

Loading…
Cancel
Save