fix get_content() on an URL (instead of integer ID)
This commit is contained in:
parent
710d8ffd54
commit
430291a7e2
2 changed files with 8 additions and 2 deletions
|
|
@ -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)
|
raise TypeError("The parameter 'contact' isn't a contact nor a int/long/str/unicode: %s" % contact)
|
||||||
|
|
||||||
profile = self.browser.get_profile(_id)
|
profile = self.browser.get_profile(_id)
|
||||||
|
if not profile:
|
||||||
|
return None
|
||||||
|
|
||||||
|
_id = profile.id
|
||||||
|
|
||||||
if profile.is_online():
|
if profile.is_online():
|
||||||
s = Contact.STATUS_ONLINE
|
s = Contact.STATUS_ONLINE
|
||||||
|
|
|
||||||
|
|
@ -260,7 +260,9 @@ class AuMBrowser(BaseBrowser):
|
||||||
|
|
||||||
@pageaccess
|
@pageaccess
|
||||||
def get_profile(self, link):
|
def get_profile(self, link):
|
||||||
if isinstance(link, basestring) and link.startswith('/'):
|
if isinstance(link, basestring):
|
||||||
|
link = link.replace('http://www.adopteunmec.com/', '')
|
||||||
|
if link.startswith('/'):
|
||||||
link = link[1:]
|
link = link[1:]
|
||||||
self.location('/%s' % link)
|
self.location('/%s' % link)
|
||||||
return self.page
|
return self.page
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue