Project

Profile

Help

Issue #4358

TaskSerializer is broken if created_resources has reference to Content

Added by osapryki almost 3 years ago. Updated over 2 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.

History

#1 Updated by CodeHeeler almost 3 years ago

  • Priority changed from Normal to Low
  • Triaged changed from No to Yes

#2 Updated by jortel@redhat.com almost 3 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?

#3 Updated by bmbouter over 2 years ago

  • Tags deleted (Pulp 3)

#4 Updated by osapryki over 2 years ago

  • Status changed from NEW to CLOSED - NOTABUG

Please register to edit this issue

Also available in: Atom PDF