fix(custom_fields): serialize legacy meeting objects as a list#875
Conversation
| ) | ||
|
|
||
|
|
||
| class BackwardCompatibleMeetingList(fields.List): |
There was a problem hiding this comment.
Thanks for taking this one! wouldn't it be easier to implement this only on the new jinja template (CDSMeeting)? Did you consider that?
There was a problem hiding this comment.
I did think about that. A Jinja only fix in CDSMeeting.html would cover the record page, but the edit form still loads custom_fields through the schema dump into ArrayField, so a legacy object would still break there. Doing the wrap in serialize felt cleaner so both paths get a list without touching the widget or allowing object writes.
There was a problem hiding this comment.
Yeah also the API response serializes it incorrectly too if only the jinja template is changed
palkerecsenyi
left a comment
There was a problem hiding this comment.
perfect thanks @TahaKhan998! I think this is a very nice elegant simple way to do it, I can't see any problems with it. We will make sure to test in dev with object meeting field records (we might need to create some manually).
Closes #865
This pr adds a serialize-only compatibility list field that wraps a legacy object as a one-item list for reads, leaves arrays unchanged.