Skip to content

Instantiating Serializer makes unexpected API call #4

Open
@hugorodgerbrown

Description

@hugorodgerbrown

The ContactModelSerializer and DealModelSerializer classes both include this line in the field validation method:

if field_name == 'owner_id' and field_value not in base_helpers.get_user_ids():
    return False

The call to base_helpers.get_user_ids() makes a network API call, which is not what you would expect from object instantiation. We need a way to either remove this until the synchronisation (it makes more sense to fail on sync with 'user not found' that on object instantiation), or at the very least to allow clients to force some kind of lazy validation.

The use case that highlighted this was trying to display the object JSON in the Django admin view, ironically in order to assist with debugging of synchronisation issues. If I want to load in an object, and serialize it, without pushing to Base, how can I do that?

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