mirror of
https://git.pleroma.social/pleroma/relay.git
synced 2024-11-21 22:17:59 +00:00
fix WKNodeinfo.get_url
This commit is contained in:
parent
e3bf4258aa
commit
58ebefa3bd
|
@ -487,13 +487,6 @@ class Message(DotDict):
|
||||||
|
|
||||||
|
|
||||||
class WKNodeinfo(DotDict):
|
class WKNodeinfo(DotDict):
|
||||||
def __setitem__(self, key, value):
|
|
||||||
if key == 'links':
|
|
||||||
value = [DotDict(item) for item in value]
|
|
||||||
|
|
||||||
DotDict.__setitem__(self, key, value)
|
|
||||||
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def new(cls, v20, v21):
|
def new(cls, v20, v21):
|
||||||
return cls({
|
return cls({
|
||||||
|
@ -506,7 +499,7 @@ class WKNodeinfo(DotDict):
|
||||||
|
|
||||||
def get_url(self, version='20'):
|
def get_url(self, version='20'):
|
||||||
for item in self.links:
|
for item in self.links:
|
||||||
if item.rel == NODEINFO_NS[version]:
|
if item['rel'] == NODEINFO_NS[version]:
|
||||||
return item.href
|
return item['href']
|
||||||
|
|
||||||
raise KeyError(version)
|
raise KeyError(version)
|
||||||
|
|
Loading…
Reference in a new issue