Skip to content

Commit c97de9c

Browse files
committed
fixup! feat(asset): Add common asset mixing for project and tutorial
1 parent d49c9fe commit c97de9c

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

apps/tutorial/serializers.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)