Skip to content

Commit

Permalink
feat: Format experiment collection as markdown in get experiment coll…
Browse files Browse the repository at this point in the history
…ection endpoint serializer
  • Loading branch information
drikusroor committed Jun 12, 2024
1 parent 2165b3d commit 4459bcc
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions backend/experiment/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,25 @@ def serialize_experiment_collection(
serialized = {
'slug': experiment_collection.slug,
'name': experiment_collection.name,
'description': experiment_collection.description,
'description': formatter(
experiment_collection.description,
filter_name='markdown'
),
}

if experiment_collection.consent:
serialized['consent'] = Consent(experiment_collection.consent).action()

if experiment_collection.theme_config:
serialized['theme'] = serialize_theme(
experiment_collection.theme_config)
experiment_collection.theme_config
)

if experiment_collection.about_content:
serialized['aboutContent'] = formatter(
experiment_collection.about_content, filter_name='markdown')
experiment_collection.about_content,
filter_name='markdown'
)

return serialized

Expand Down

0 comments on commit 4459bcc

Please sign in to comment.