We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 256b2cd commit abee91dCopy full SHA for abee91d
djangocms_rest/serializers/plugins.py
@@ -130,10 +130,12 @@ def to_representation(self, instance: CMSPlugin):
130
ret[field.name] = serialize_fk(
131
request,
132
field.related_model,
133
- getattr(instance, field.name + "_id"),
134
- obj=getattr(instance, field.name)
135
- if field.is_cached(instance)
136
- else None,
+ getattr(instance, f"{field.name}_id"),
+ obj=(
+ getattr(instance, field.name)
+ if field.is_cached(instance)
137
+ else None
138
+ ),
139
)
140
elif isinstance(field, JSON_FIELDS) and ret.get(field.name):
141
# If the field is a subclass of JSONField, serialize its value directly
0 commit comments