From 26a5cc3de7b397dfd00903ea2659b73b966f15c8 Mon Sep 17 00:00:00 2001 From: =?utf-8?q?Toshio=20=E3=81=8F=E3=82=89=E3=81=A8=E3=81=BF?= Date: Tue, 22 Feb 2011 17:09:49 +0000 Subject: [PATCH] Fix search engines hitting the login page and causing a traceback --- .../hotfix/files/transifex/tx-simpleauth-views.py | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/modules/hotfix/files/transifex/tx-simpleauth-views.py b/modules/hotfix/files/transifex/tx-simpleauth-views.py index f38234c..d4ccb48 100644 --- a/modules/hotfix/files/transifex/tx-simpleauth-views.py +++ b/modules/hotfix/files/transifex/tx-simpleauth-views.py @@ -19,8 +19,11 @@ def logout(request, template_name='simpleauth/logged_out.html'): def login(request, template_name='simpleauth/signin.html'): """Login the user to the website and redirect back.""" # Migration to fedora.transifex.net - request.user.message_set.create( - message=_("Login is disabled due to migration to fedora.transifex.net.")) + try: + request.user.message_set.create( + message=_("Login is disabled due to migration to fedora.transifex.net.")) + except: + pass return HttpResponseRedirect(reverse('transifex.home')) # next = clean_next(request.GET.get('next')) # # By default keep the user logged in for 3 weeks -- 1.5.5.6