`Search().lookup_user()` now returns response code (just in case
authorMarek Marecki <triviuss@gmail.com>
Sat, 6 Jul 2013 20:25:33 +0000 (22:25 +0200)
committerMarek Marecki <triviuss@gmail.com>
Sat, 6 Jul 2013 20:25:33 +0000 (22:25 +0200)
somebody would find it useful)

diaspy/search.py

index 7467295ab4e276aa2ec3dd0c90dededc1db52ff5..6da1beba09683c2d48c2a0fedc26f156c38c5285 100644 (file)
@@ -12,9 +12,10 @@ class Search():
 
     def lookup_user(self, handle):
         """This function will launch a webfinger lookup from the pod for the
-        handle requested. Nothing is returned but if the lookup was successful,
-        user should soon be searchable via this pod.
-        
+        handle requested. Response code is returned and if the lookup was successful,
+        user should soon be searchable via pod used for connection.
+
         :param string: Handle to search for.
         """
-        request = self.get('people', headers={'accept': 'text/html'}, params={'q':handle})
+        request = self.get('people', headers={'accept': 'text/html'}, params={'q': handle})
+        return request.status_code