From 86f4566fce939dac880de19df6c18b5f8d3344c1 Mon Sep 17 00:00:00 2001 From: Lincoln de Sousa Date: Wed, 26 Sep 2007 20:20:24 -0300 Subject: [PATCH] =?utf8?q?fazendo=20o=20sistema=20"lembrar"=20da=20escolha?= =?utf8?q?=20de=20comercial=20ou=20n=C3=A3o=20comercial=20por=20parte=20do?= =?utf8?q?=20participante?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- eventos/models.py | 1 + views.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/eventos/models.py b/eventos/models.py index ffc4ebc..e698eab 100644 --- a/eventos/models.py +++ b/eventos/models.py @@ -98,6 +98,7 @@ class Participante(models.Model): cep = models.CharField(maxlength=8) usuario = models.ForeignKey(User) + comercial = models.BooleanField(default=False) refbanco = models.IntegerField() class Admin: diff --git a/views.py b/views.py index 010afaf..26b03cf 100644 --- a/views.py +++ b/views.py @@ -146,7 +146,6 @@ def inscricao_individual(request): ok = False if request.POST and form.is_valid(): cd = form.cleaned_data - group = Group.objects.get_or_create(name='participantes')[0] user = User(username=cd['nome_usuario'], email=cd['email']) @@ -168,6 +167,7 @@ def inscricao_individual(request): p.refbanco = 0 p.telefone = cd['telefone'] p.home_page = cd['home_page'] + p.comercial = cd['inscricao_comercial'] p.save() u = authenticate(username=cd['nome_usuario'], password=cd['senha']) @@ -208,6 +208,7 @@ def inscricao_caravana(request): p.refbanco = 0 p.telefone = cd['telefone'] p.home_page = cd['home_page'] + p.comercial = False # yeah, always false! p.save() c = Caravana() -- 2.20.1