Skip to content

Commit

Permalink
Pull Organization Description from LFX Org profile if it is set (#81)
Browse files Browse the repository at this point in the history
Signed-off-by: John Mertic <[email protected]>
  • Loading branch information
jmertic authored Dec 2, 2024
1 parent 955ad20 commit f054b19
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions lfx_landscape_tools/lfxmembers.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def loadData(self):
member.membership = record.get('Membership',{}).get('Name')
member.website = record.get('Website')
member.logo = record.get('Logo')
member.description = record.get('OrganizationDescription')
if not member.logo:
logger.info("Trying to create text logo")
member.logo = SVGLogo(name=member.orgname)
Expand Down
3 changes: 2 additions & 1 deletion test/test_lfxmembers.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def testLoadData(self):
responses.add(
method=responses.GET,
url=LFXMembers.endpointURL.format('tlf2'),
body="""[{"ID":"0014100000Te1TUAAZ","Name":"ConsenSys AG","CNCFLevel":"","LinkedInURL":"dog.com","CrunchBaseURL":"https://crunchbase.com/organization/consensus-systems--consensys-","Logo":"https://lf-master-organization-logos-prod.s3.us-east-2.amazonaws.com/consensys_ag.svg","Membership":{"Family":"Membership","ID":"01t41000002735aAAA","Name":"Premier Membership","Status":"Active"},"Slug":"hyp","StockTicker":"","Twitter":"","Website":"consensys.net"},{"ID":"0014100000Te04HAAR","Name":"Hitachi, Ltd.","CNCFLevel":"","LinkedInURL":"www.linkedin.com/company/hitachi-data-systems","Logo":"https://lf-master-organization-logos-prod.s3.us-east-2.amazonaws.com/hitachi-ltd.svg","Membership":{"Family":"Membership","ID":"01t41000002735aAAA","Name":"Premier Membership","Status":"Active"},"Slug":"hyp","StockTicker":"","Twitter":"https://yahoo.com","Website":"hitachi-systems.com"}]"""
body="""[{"ID":"0014100000Te1TUAAZ","Name":"ConsenSys AG","CNCFLevel":"","OrganizationDescription":"this org is cool","LinkedInURL":"dog.com","CrunchBaseURL":"https://crunchbase.com/organization/consensus-systems--consensys-","Logo":"https://lf-master-organization-logos-prod.s3.us-east-2.amazonaws.com/consensys_ag.svg","Membership":{"Family":"Membership","ID":"01t41000002735aAAA","Name":"Premier Membership","Status":"Active"},"Slug":"hyp","StockTicker":"","Twitter":"","Website":"consensys.net"},{"ID":"0014100000Te04HAAR","Name":"Hitachi, Ltd.","CNCFLevel":"","LinkedInURL":"www.linkedin.com/company/hitachi-data-systems","Logo":"https://lf-master-organization-logos-prod.s3.us-east-2.amazonaws.com/hitachi-ltd.svg","Membership":{"Family":"Membership","ID":"01t41000002735aAAA","Name":"Premier Membership","Status":"Active"},"Slug":"hyp","StockTicker":"","Twitter":"https://yahoo.com","Website":"hitachi-systems.com"}]"""
)
responses.add(
method=responses.GET,
Expand All @@ -77,6 +77,7 @@ def testLoadData(self):
self.assertEqual(members.members[0].crunchbase,"https://www.crunchbase.com/organization/consensus-systems--consensys-")
self.assertEqual(members.members[0].logo,"consensys_ag.svg")
self.assertEqual(members.members[0].membership,"Premier Membership")
self.assertEqual(members.members[0].description,"this org is cool")
self.assertEqual(members.members[0].website,"https://consensys.net/")
self.assertIsNone(members.members[0].linkedin)
self.assertIsNone(members.members[0].twitter)
Expand Down

0 comments on commit f054b19

Please sign in to comment.