File tree Expand file tree Collapse file tree
src/openedx_content/applets/backup_restore Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -156,16 +156,12 @@ class CollectionSerializer(serializers.Serializer): # pylint: disable=abstract-
156156 Serializer for collections.
157157 """
158158 title = serializers .CharField (required = True )
159- # Note: the model field is now Collection.collection_code, but the archive
160- # format still uses "key". A future v2 format may align the name.
161- key = serializers .CharField (required = True )
159+ # The model field is now Collection.collection_code, but the archive format
160+ # still uses "key". A future v2 format may align the name.
161+ key = serializers .CharField (required = True , source = "collection_code" )
162162 description = serializers .CharField (required = True , allow_blank = True )
163163 entities = serializers .ListField (
164164 child = serializers .CharField (),
165165 required = True ,
166166 allow_empty = True ,
167167 )
168-
169- def validate (self , attrs ):
170- attrs ["collection_code" ] = attrs .pop ("key" )
171- return attrs
You can’t perform that action at this time.
0 commit comments