Project

Profile

Help

Issue #4358

closed

TaskSerializer is broken if created_resources has reference to Content

Added by osapryki about 5 years ago. Updated over 4 years ago.

Status:
CLOSED - NOTABUG
Priority:
Low
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:

Description

Summary:

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.

pulpcore/app/serializers/task.py: 82

 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.

Actions #1

Updated by CodeHeeler about 5 years ago

  • Priority changed from Normal to Low
  • Triaged changed from No to Yes
Actions #2

Updated by jortel@redhat.com about 5 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?

Actions #3

Updated by bmbouter almost 5 years ago

  • Tags deleted (Pulp 3)
Actions #4

Updated by osapryki over 4 years ago

  • Status changed from NEW to CLOSED - NOTABUG

Also available in: Atom PDF