Skip to content

Commit

Permalink
Build: fix API call to version.patch() (#10175)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
stsewd committed Mar 22, 2023
1 parent 2d0dbcb commit eadf6ac
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion readthedocs/api/v2/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ class VersionAdminSerializer(VersionSerializer):

project = ProjectAdminSerializer()
canonical_url = serializers.SerializerMethodField()
build_data = serializers.JSONField(required=False, write_only=True)
build_data = serializers.JSONField(required=False, write_only=True, allow_null=True)

def get_canonical_url(self, obj):
return obj.project.get_docs_url(
Expand Down
1 change: 1 addition & 0 deletions readthedocs/proxito/tests/test_hosting.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
@override_settings(
PUBLIC_DOMAIN="dev.readthedocs.io",
PUBLIC_DOMAIN_USES_HTTPS=True,
GLOBAL_ANALYTICS_CODE=None,
)
@pytest.mark.proxito
class TestReadTheDocsConfigJson(TestCase):
Expand Down

0 comments on commit eadf6ac

Please sign in to comment.