Skip to content

TypeError: Can't convert 'NoneType' object to str implicitly #45

@ToddJacobus

Description

@ToddJacobus

Out of the box, running Python 3.5.5, I encountered the below error:

Traceback (most recent call last): File "push_posts_to_insightly.py", line 59, in <module> fetchRecordsFromInsightly() File "push_posts_to_insightly.py", line 56, in fetchRecordsFromInsightly i = Insightly(apikey=INSIGHTLY_API_KEY) File "K:\003_Scripts\web_services_development\aoi_webmap\post-processing\insightly.py", line 292, in __init__ self.owner_name = u.get('FIRST_NAME','') + ' ' + u.get('LAST_NAME','') TypeError: Can't convert 'NoneType' object to str implicitly

I fixed this issue by just adding a conditional to how self.owner_name gets assigned:

if u.get('FIRST_NAME','') ==None or u.get('LAST_NAME','') == None: self.owner_name = "None" else: self.owner_name = u.get('FIRST_NAME','') + ' ' + u.get('LAST_NAME','')

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions