[Change Request] Fix transifex disablement to not traceback w/ search engines

Toshio Kuratomi a.badger at gmail.com
Tue Feb 22 17:13:55 UTC 2011


Search engines are hitting the login page and tripping a traceback.  I'd
like to apply this patch to our hotfix from yesterday in order to fix that.
Issue reported here:

https://fedorahosted.org/fedora-infrastructure/ticket/2638

Can I get two +1's?

-Toshio
-------------- next part --------------
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?= <toshio at puppet01.phx2.fedoraproject.org>
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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
Url : http://lists.fedoraproject.org/pipermail/infrastructure/attachments/20110222/1c76c685/attachment.bin 


More information about the infrastructure mailing list