1717)
1818
1919
20+ class LibraryMigrationCollectionSerializer (serializers .ModelSerializer ):
21+ """
22+ Serializer for the target collection of a library migration.
23+ """
24+ class Meta :
25+ model = Collection
26+ fields = ["key" , "title" ]
27+
28+
2029class ModulestoreMigrationSerializer (serializers .Serializer ):
2130 """
2231 Serializer for the course or legacylibrary to library V2 import creation API.
@@ -53,6 +62,7 @@ class ModulestoreMigrationSerializer(serializers.Serializer):
5362 allow_blank = True ,
5463 default = None ,
5564 )
65+ target_collection = LibraryMigrationCollectionSerializer (required = False )
5666 forward_source_to_target = serializers .BooleanField (
5767 help_text = "Forward references of this block source over to the target of this block migration." ,
5868 required = False ,
@@ -226,19 +236,11 @@ def get_display_name(self, obj):
226236 return self .context ["course_names" ].get (str (obj .key ), None )
227237
228238
229- class LibraryMigrationCollectionSerializer (serializers .ModelSerializer ):
230- """
231- Serializer for the target collection of a library migration.
232- """
233- class Meta :
234- model = Collection
235- fields = ["key" , "title" ]
236-
237-
238239class LibraryMigrationCourseSerializer (serializers .ModelSerializer ):
239240 """
240241 Serializer for the course or legacylibrary migrations to V2 library.
241242 """
243+ task_uuid = serializers .UUIDField (source = 'task_status.uuid' , read_only = True )
242244 source = LibraryMigrationCourseSourceSerializer () # type: ignore[assignment]
243245 target_collection = LibraryMigrationCollectionSerializer (required = False )
244246 state = serializers .SerializerMethodField ()
@@ -247,6 +249,7 @@ class LibraryMigrationCourseSerializer(serializers.ModelSerializer):
247249 class Meta :
248250 model = ModulestoreMigration
249251 fields = [
252+ 'task_uuid' ,
250253 'source' ,
251254 'target_collection' ,
252255 'state' ,
0 commit comments