-
Notifications
You must be signed in to change notification settings - Fork 601
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Ensure that Box content is rendered after update (#2638)
This resolves the underlying problem from #2631. When updated via Django's [`update_or_create`](https://docs.djangoproject.com/en/4.2/ref/models/querysets/#update-or-create), the new `content` for a `Box` is not rendered by django-markupfield's [`pre_save`](https://github.com/jamesturk/django-markupfield/blob/2.0.1/markupfield/fields.py#L163-L179) method unless `save()` is called. This is due to the fact that [`update`](https://docs.djangoproject.com/en/4.2/ref/models/querysets/#django.db.models.query.QuerySet.update) bypasses calls to `save`, `pre_save`, and `post_save`, from the docs: > Finally, realize that update() does an update at the SQL level and, thus, does not call any save() methods on your models, nor does it emit the pre_save or post_save signals (which are a consequence of calling Model.save())
- Loading branch information
Showing
3 changed files
with
15 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters