Skip to content
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

Fix DoesNotExist exception in content serializer #1365

Merged
merged 1 commit into from
Nov 27, 2018

Conversation

cutwater
Copy link
Collaborator

The QuerySet.latest method raises DoesNotExist exception if
query returns empty set. This patch fixes the issue and returns
empty list for task_messages field if no import task exists
for a content's repository.

Additionally it replaces id attribute access through a related object
with direct foreign key repository_id.

It also replaces import task sorting by id with sorting by created
date as it's better way of determining latest record.

Backport: #1364

(cherry picked from commit 410c81c)

The `QuerySet.latest` method raises `DoesNotExist` exception if
query returns empty set. This patch fixes the issue and returns
empty list for `task_messages` field if no import task exists
for a content's repository.

Additionally it replaces `id` attribute access through a related object
with direct foreign key `repository_id`.

It also replaces import task sorting by `id` with sorting by `created`
date as it's better way of determining latest record.

(cherry picked from commit 410c81c)
@cutwater cutwater added the backport Backport pull request label Nov 26, 2018
@cutwater cutwater merged commit 3d7ec98 into ansible:stable/3.1 Nov 27, 2018
@cutwater cutwater deleted the backport/3.1/1364 branch November 27, 2018 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Backport pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant