Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Ensure we can get the related resource type of tracked fields #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 29, 2019

Conversation

tabby-or-not
Copy link

  • Add elif clause for tracked fields to make sure the model can be read
    These fields are wrapped in a DescriptorWrapper by django-model-utils and we can't access the underlying field so we need to read the model off of the descriptor.

@@ -197,6 +197,13 @@ def get_related_resource_type(relation):
# For ManyToMany relationships, get the model from the child
# serializer of the list serializer
relation_model = relation.child.Meta.model
# Check fields wrapped in a DescriptorWrapper (tracked fields)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be a little clearer here and explicitly name django-model-utils and FieldTracker.

@tabby-or-not tabby-or-not force-pushed the hotfix/tracked-field-types branch from b491651 to a11cdbd Compare May 29, 2019 02:36
@furious-luke furious-luke merged commit 935a8e1 into master May 29, 2019
@furious-luke furious-luke deleted the hotfix/tracked-field-types branch May 29, 2019 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants