fix get_content() on an URL (instead of integer ID)

This commit is contained in:
Romain Bignon 2010-10-30 12:30:46 +02:00
commit 430291a7e2
2 changed files with 8 additions and 2 deletions

View file

@ -299,6 +299,10 @@ class AuMBackend(BaseBackend, ICapMessages, ICapMessagesPost, ICapDating, ICapCh
raise TypeError("The parameter 'contact' isn't a contact nor a int/long/str/unicode: %s" % contact)
profile = self.browser.get_profile(_id)
if not profile:
return None
_id = profile.id
if profile.is_online():
s = Contact.STATUS_ONLINE

View file

@ -260,8 +260,10 @@ class AuMBrowser(BaseBrowser):
@pageaccess
def get_profile(self, link):
if isinstance(link, basestring) and link.startswith('/'):
link = link[1:]
if isinstance(link, basestring):
link = link.replace('http://www.adopteunmec.com/', '')
if link.startswith('/'):
link = link[1:]
self.location('/%s' % link)
return self.page