Skip to content

Card.associate_to_customer(customer) fails #105

@quangkcao

Description

@quangkcao

When I call: MYCARD.associate_to_customer(customer)
It fails to save when adding new attribute 'links' to Card object as indicated in resources.py:

class FundingInstrument(Resource):
...
    def associate_to_customer(self, customer):
        try:
            self.links
        except AttributeError:
            self.links = {}
        self.links['customer'] = utils.extract_href_from_object(customer)
        self.save()

In fact, at the end of saving process, MYCARD got a new attribute called 'customer_href' instead of 'links' that I expected. Next, I fetch MYCARD again to see its response, but neither 'links' nor 'customer_href' is on MYCARD. However, the number of cards associated with the customer increases by one.

I'd appreciate any help.
Thanks!

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