From f63040bc2d7e4b28e6772d335ca1a5a8c643f317 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 12 Aug 2024 14:25:26 +0100 Subject: [PATCH] Handling skills list --- pgp.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pgp.py b/pgp.py index 061dcaa33..25803f1a0 100644 --- a/pgp.py +++ b/pgp.py @@ -757,9 +757,14 @@ def actor_to_vcard(actor: {}, domain: str) -> str: vcard_str += 'IMPP:cwtch:' + cwtch_address + '\n' oc_skills_list = get_occupation_skills(actor) if oc_skills_list: - for skill_name, skill_level in oc_skills_list.items(): - if not isinstance(skill_level, int): + for skill_name in oc_skills_list: + if ':' not in skill_name: continue + skill_level = skill_name.split(':')[1] + if not skill_level.isdigit(): + continue + skill_level = int(skill_level) + skill_name = skill_name.split(':')[0].strip().lower() if not skill_name: continue level_str = None