]> git.openstreetmap.org Git - osqa.git/commitdiff
Unknown user handling changes.
authorhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Wed, 12 May 2010 10:22:03 +0000 (10:22 +0000)
committerhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Wed, 12 May 2010 10:22:03 +0000 (10:22 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@233 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum_modules/sximporter/importer.py

index b5bb0a66329a82c593d01d81c3f9220a216c845c..5d0c99b4ac81ca83aff9b4b476178a3d669e5750 100644 (file)
@@ -55,24 +55,22 @@ def final_username_attempt(sxu):
 \r
     if openid:\r
         if google_accounts_lookup.search(openid):\r
-            return UnknownGoogleUser()\r
+            return UnknownGoogleUser(sxu.get('id'))\r
         if yahoo_accounts_lookup.search(openid):\r
-            return UnknownYahooUser()\r
+            return UnknownYahooUser(sxu.get('id'))\r
 \r
         for lookup in openid_lookups:\r
             if lookup.search(openid):\r
                 return lookup.search(openid).group('uname')\r
 \r
-    return UnknownUser()\r
+    return UnknownUser(sxu.get('id'))\r
 \r
 class UnknownUser(object):\r
-    counter = 0\r
-    def __init__(self):\r
-        self.__class__.counter += 1\r
-        self.number = self.__class__.counter\r
+    def __init__(self, id):\r
+        self._id = id\r
 \r
     def __str__(self):\r
-        return _("Unknown user %(number)d") % {'number': self.number}\r
+        return _("user-%(id)d") % {'id': self._id}\r
 \r
     def __unicode__(self):\r
         return self.__str__()\r
@@ -81,16 +79,12 @@ class UnknownUser(object):
         return self.__str__()\r
 \r
 class UnknownGoogleUser(UnknownUser):\r
-    counter = 0\r
-\r
     def __str__(self):\r
-        return _("Unknown google user %(number)d") % {'number': self.number}\r
+        return _("user-%(id)d (google)") % {'id': self._id}\r
 \r
 class UnknownYahooUser(UnknownUser):\r
-    counter = 0\r
-\r
     def __str__(self):\r
-        return _("Unknown yahoo user %(number)d") % {'number': self.number}\r
+        return _("user-%(id)d (yahoo)") % {'id': self._id}\r
 \r
 \r
 class IdMapper(dict):\r