Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug with social media accounts on new editions #9038

Merged
merged 1 commit into from
May 15, 2024
Merged

Conversation

brucebolt
Copy link
Member

When an Editionable Worldwide Organisation was being editioned (i.e. a new draft created), the social media accounts were lost, but only for worldwide organisations that had no translations.

This was because we were using the build method to create the record but never saving it.

For the worldwide organisations with translations, the call to update saved the record, but this never happened for those without translations.

The tests did not catch this as create_draft returns the unsaved object. Therefore reloading the object in the test to ensure we get the persisted object from the database.

Trello card

@brucebolt brucebolt marked this pull request as ready for review May 14, 2024 15:27
When an Editionable Worldwide Organisation was being editioned (i.e. a
new draft created), the social media accounts were lost, but only for
worldwide organisations that had no translations.

This was because we were using the `build` method to create the record
but never saving it.

For the worldwide organisations with translations, the call to `update`
saved the record, but this never happened for those without
translations.

The tests did not catch this as `create_draft` returns the unsaved
object. Therefore reloading the object in the test to ensure we get the
persisted object from the database.
@brucebolt brucebolt merged commit 77a230e into main May 15, 2024
23 checks passed
@brucebolt brucebolt deleted the fix-ww-org-social branch May 15, 2024 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants