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

The import procedure incorrectly counts the number of imported content #3113

Closed
lubosmj opened this issue Aug 22, 2022 · 0 comments · Fixed by #3120
Closed

The import procedure incorrectly counts the number of imported content #3113

lubosmj opened this issue Aug 22, 2022 · 0 comments · Fixed by #3120

Comments

@lubosmj
Copy link
Member

lubosmj commented Aug 22, 2022

content = Content.objects.filter(upstream_id__in=content_ids)
with repo.new_version() as new_version:
new_version.set_content(content)
else:
# just map all the content to our destination repo
content = Content.objects.filter(pk__in=resulting_content_ids)
with dest_repo.new_version() as new_version:
new_version.set_content(content)
content_count = content.count()

We are overwriting the content_count variable in a loop over and over again. We should instead accumulate the number of imported content and then save it to a progress bar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant