File tree Expand file tree Collapse file tree 1 file changed +0
-19
lines changed
Expand file tree Collapse file tree 1 file changed +0
-19
lines changed Original file line number Diff line number Diff line change @@ -325,30 +325,11 @@ class Meta: # type: ignore[reportIncompatibleVariableOverride]
325325 model = Tutorial
326326 fields = (
327327 "name" ,
328- "project" ,
329328 "status" ,
330329 "information_pages" ,
331330 "scenarios" ,
332331 )
333332
334- def validate_project (self , project : Project ) -> Project :
335- assert self .instance is not None , "Tutorial does not exist."
336-
337- if self .instance .status_enum == Tutorial .Status .PUBLISHED and project != self .instance .project :
338- raise serializers .ValidationError (
339- gettext ("Project cannot be changed once the tutorial is published." ),
340- )
341-
342- if self .instance .project .project_type_enum != project .project_type_enum :
343- raise serializers .ValidationError (
344- gettext ("Existing tutorial project type '%s' does not match new project type '%s'" )
345- % (
346- Project .Type (self .instance .project .project_type_enum ).label ,
347- Project .Type (project .project_type_enum ).label ,
348- ),
349- )
350- return project
351-
352333 def validate_status (self , new_status : Tutorial .Status | int ) -> Tutorial .Status :
353334 assert self .instance is not None , "Tutorial does not exist."
354335
You can’t perform that action at this time.
0 commit comments