Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions data_wizard/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ def to_internal_value(self, data):
except ContentType.DoesNotExist:
self.fail('does_not_exist', app_label=app_label, model=model)

def to_representation(self, content_type_id):
ct = ContentType.objects.get(pk=content_type_id)
def to_representation(self, content_type):
ct = ContentType.objects.get(pk=content_type.pk)
Copy link
Author

Choose a reason for hiding this comment

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

Alternatively, rather than redoing the lookup, we can just immediately:

def to_representation(self, content_type):
    return '%s.%s' % (content_type.app_label, content_type.model)

return '%s.%s' % (ct.app_label, ct.model)


Expand Down