Skip to content

Commit

Permalink
Add registration_schema to DraftRegistrationDetailSerializer
Browse files Browse the repository at this point in the history
Recent DRF upgrade fixed a day-one bug which affects MRO. Have to
explicity define registration_schema to prevent this property from
inheriting from the wwrong parent.

Co-authored-by: John Tordoff <johnetordoff@gmail.com>
  • Loading branch information
cslzchen and Johnetordoff committed Sep 13, 2022
1 parent 494e396 commit 6548110
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions api/draft_registrations/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
NodeContributorsSerializer,
NodeContributorsCreateSerializer,
NodeContributorDetailSerializer,
RegistrationSchemaRelationshipField,
)
from api.taxonomies.serializers import TaxonomizableSerializerMixin
from osf.exceptions import DraftRegistrationStateError
Expand Down Expand Up @@ -143,6 +144,13 @@ class DraftRegistrationDetailSerializer(DraftRegistrationSerializer, DraftRegist
registration_supplement, node, cannot be changed after draft has been created.
"""

registration_schema = RegistrationSchemaRelationshipField(
related_view='schemas:registration-schema-detail',
related_view_kwargs={'schema_id': '<registration_schema._id>'},
required=False,
read_only=False,
)

links = LinksField({
'self': 'get_self_url',
})
Expand Down

0 comments on commit 6548110

Please sign in to comment.