Skip to content

Build: fix API call to version.patch() #10175

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

Merged
merged 3 commits into from
Mar 22, 2023
Merged

Build: fix API call to version.patch() #10175

merged 3 commits into from
Mar 22, 2023

Conversation

stsewd
Copy link
Member

@stsewd stsewd commented Mar 21, 2023

The attribute in the serializer isn't declared as allow_null=True, so the call to patch fails for projects that aren't using this new build_data feature.

api_v2.version(self.data.version.pk).patch(
{
"built": True,
"documentation_type": self.data.version.documentation_type,
"has_pdf": "pdf" in valid_artifacts,
"has_epub": "epub" in valid_artifacts,
"has_htmlzip": "htmlzip" in valid_artifacts,
"build_data": self.data.version.build_data,
}
)

We could also add allow_null=True in the attribute, I'm fine with that solution too.

This also fixes tests on .com.

The attribute in the serializer isn't declared as allow_null=True,
so the call to patch fails for projects that aren't using this new
feature.

This also fixes tests on .com.
@stsewd stsewd requested a review from a team as a code owner March 21, 2023 22:51
@stsewd stsewd requested a review from humitos March 21, 2023 22:51
@humitos
Copy link
Member

humitos commented Mar 22, 2023

We could also add allow_null=True in the attribute, I'm fine with that solution too.

Yes, this is the correct way 👍🏼

@humitos
Copy link
Member

humitos commented Mar 22, 2023

Just wanted to note here that this is not failing now in production because we rolled back the builders, since they were failing due to a PATH miss configuration.

@stsewd stsewd merged commit eadf6ac into main Mar 22, 2023
@stsewd stsewd deleted the fix-versions-api branch March 22, 2023 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants