From 58ebefa3bddede079a81d0a9d679c7d32b2f082b Mon Sep 17 00:00:00 2001 From: Izalia Mae Date: Mon, 7 Nov 2022 08:24:03 -0500 Subject: [PATCH] fix WKNodeinfo.get_url --- relay/misc.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/relay/misc.py b/relay/misc.py index 64399fb..68f36dc 100644 --- a/relay/misc.py +++ b/relay/misc.py @@ -487,13 +487,6 @@ class Message(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 def new(cls, v20, v21): return cls({ @@ -506,7 +499,7 @@ class WKNodeinfo(DotDict): def get_url(self, version='20'): for item in self.links: - if item.rel == NODEINFO_NS[version]: - return item.href + if item['rel'] == NODEINFO_NS[version]: + return item['href'] raise KeyError(version)