TaskSerializer is broken if created_resources has reference to Content
CLOSED - NOTABUG
TaskViewSet fails with exception when trying to request task details if a task has reference to a Content model.
File "/var/lib/galaxy/venv/lib64/python3.6/site-packages/pulpcore/app/serializers/repository.py", line 501, in get_content_hrefs ctype_view = get_view_name_for_model(ctype_model, 'list') File "/var/lib/galaxy/venv/lib64/python3.6/site-packages/pulpcore/app/util.py", line 66, in get_view_name_for_model raise LookupError('view not found') LookupError: view not found
An exception is raised when trying to serialize created_resources field in TaskSerializer.
created_resources = CreatedResourceSerializer( help_text=_('Resources created by this task.'), many=True, read_only=True, view_name='None' # This is a polymorphic field. The serializer does not need a view name. )
Steps to reproduce¶
1. Implement a task that creates a Content model instance.
2. Execute task and get task URL.
3. Request task URL.
Updated by CodeHeeler about 4 years ago
- Priority changed from Normal to Low
- Triaged changed from No to Yes
Updated by firstname.lastname@example.org about 4 years ago
The Task.created_resources is really not intended for Content related resources but rather things like Publication. Can you help me understand the use case behind this?
Updated by bmbouter almost 4 years ago
- Tags deleted (
Updated by osapryki over 3 years ago
- Status changed from NEW to CLOSED - NOTABUG