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 logic to build internal/external versions on management command #6427

Closed
stsewd opened this issue Dec 3, 2019 · 0 comments · Fixed by #6442
Closed

Fix logic to build internal/external versions on management command #6427

stsewd opened this issue Dec 3, 2019 · 0 comments · Fixed by #6442
Labels
Bug A bug Good First Issue Good for new contributors

Comments

@stsewd
Copy link
Member

stsewd commented Dec 3, 2019

We are building only external/internal versions if we pass the magic word external/internal

elif version == INTERNAL:
log.info('Updating all internal versions for %s', slug)
for version in Version.internal.filter(
project__slug=slug,
active=True,
uploaded=False,
):
build = Build.objects.create(
project=version.project,
version=version,
type='html',
state='triggered',
)
# pylint: disable=no-value-for-parameter
tasks.update_docs_task(
version.project_id,
build_pk=build.pk,
version_pk=version.pk,
)
elif version == EXTERNAL:

But we first check if version isn't None or different than all

Meaning we never hit the internal/external elifs

We should just check for all these special values first.

Also, maybe add the same logic for the else in the bottom

if version == 'all':
log.info('Updating all versions')
for version in Version.objects.filter(
active=True,
uploaded=False,
):
trigger_build(project=version.project, version=version)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug Good First Issue Good for new contributors
Projects
None yet
1 participant