Skip to content

__setattr__ overriding causing some unexpected behavior #177

@hickeroar

Description

@hickeroar

I was attempting to add companies to a user by using:
user.companies.append({"company_id": "abc123", "name": "Test Company"})
Since this doesn't trigger __setattr__, it's never marked for sending to the API when save() is called.

I'm not sure if this issue is a priority for you, or what a decent solution might be, but it had me pulling my hair out before I realized what was going on. It seems like this might be something of a design flaw in the way the library works.

Workaround is:

companies = user.companies
companies.append({"company_id": "abc123", "name": "Test Company"})
user.companies = companies

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