diff --git a/server/api/graphene_wagtail.py b/server/api/graphene_wagtail.py index 45ef9a7c..39786509 100644 --- a/server/api/graphene_wagtail.py +++ b/server/api/graphene_wagtail.py @@ -19,10 +19,7 @@ class GenericStreamFieldType(Scalar): @staticmethod def serialize(stream_value): raw_data = stream_value.raw_data - return augment_fields(raw_data) - - # by_api = stream_value.stream_block.get_api_representation(stream_value) - # return by_api + return list(augment_fields(raw_data)) def augment_fields(raw_data): @@ -94,4 +91,3 @@ def augment_fields(raw_data): @convert_django_field.register(StreamField) def convert_stream_field(field, registry=None): return GenericStreamFieldType(description=field.help_text, required=not field.null) - diff --git a/server/books/schema/nodes/content.py b/server/books/schema/nodes/content.py index f041d69b..4de75eb8 100644 --- a/server/books/schema/nodes/content.py +++ b/server/books/schema/nodes/content.py @@ -57,7 +57,6 @@ class ContentBlockNode(DjangoObjectType, HiddenAndVisibleForMixin): def resolve_contents(self, info, **kwargs): updated_raw_data = [] - # todo: deprecated as of wagtail 2.12 https://docs.wagtail.io/en/stable/releases/2.12.html for content in self.contents.raw_data: # only show solutions to teachers and students for whom their teachers have them enabled if is_solution_and_hidden_for_user(content['type'], info.context.user, self.module): @@ -71,7 +70,6 @@ class ContentBlockNode(DjangoObjectType, HiddenAndVisibleForMixin): content = process_module_room_slug_block(content) updated_raw_data.append(content) - # todo: deprecated as of wagtail 2.12 https://docs.wagtail.io/en/stable/releases/2.12.html self.contents.raw_data = updated_raw_data return self.contents