Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
+ Changes:
+
* Lincoln de Sousa (22 Jul 2007) adding is_login_form here.
+
"""
from django.contrib.auth.forms import AuthenticationForm
from django.contrib.auth import login
request.session.delete_test_cookie()
except KeyError:
pass
+ return HttpResponseRedirect('/')
else:
- # TODO: Notify the user that data sent is wrong.
- msg = _('User name and Password doesn\'t match')
- request.error_message = msg
+ return HttpResponseRedirect('/?login_failed')
request.session.set_test_cookie()
return func(request, *args, **kwargs)
news = Noticia.objects.order_by('-data_criacao')
menus = Menu.objects.all()
index_sections = Secao.objects.filter(index=True)
+ login_failed = 'login_failed' in request.GET
c = {'news': news, 'menu': menus,
- 'index_sections': index_sections}
+ 'index_sections': index_sections,
+ 'login_failed': login_failed}
c.update(extra)
return render_to_response(template, Context(c),
context_instance=RequestContext(request))
wrong = False
if not cd['telefone'] and not cd['celular']:
- badattr['telefone_comercial'] = ['Algum número de telefone '
- 'precisa ser informado']
+ badattr['telefone_comercial'] = \
+ ['Algum número de telefone precisa ser informado']
wrong = True
# don't save duplicated users...
t.render(c), FROM_EMAIL, [email])
m.send()
except Exception:
- badattr['email'] = ['Não pude enviar o email de confirmação']
+ badattr['email'] = \
+ ['Desculpe mas não pude enviar o email de confirmação']
transaction.rollback()
else:
ok = True