Fix NameError when getting nodeinfo software name in processors

This commit is contained in:
Izalia Mae 2022-12-04 04:16:50 -05:00
parent 6b86bb7d98
commit 9f58c88e9f

View file

@ -50,7 +50,7 @@ async def handle_forward(request):
async def handle_follow(request): async def handle_follow(request):
nodeinfo = await request.app.client.fetch_nodeinfo(request.actor.domain) nodeinfo = await request.app.client.fetch_nodeinfo(request.actor.domain)
software = nodeinfo.swname if nodeinfo else None software = nodeinfo.sw_name if nodeinfo else None
## reject if software used by actor is banned ## reject if software used by actor is banned
if request.config.is_banned_software(software): if request.config.is_banned_software(software):
@ -119,7 +119,7 @@ async def run_processor(request):
nodeinfo = await request.app.client.fetch_nodeinfo(request.instance['domain']) nodeinfo = await request.app.client.fetch_nodeinfo(request.instance['domain'])
if nodeinfo: if nodeinfo:
request.instance['software'] = nodeinfo.swname request.instance['software'] = nodeinfo.sw_name
request.database.save() request.database.save()
logging.verbose(f'New "{request.message.type}" from actor: {request.actor.id}') logging.verbose(f'New "{request.message.type}" from actor: {request.actor.id}')