From 74ac2d96ee991391556830649e4931955ba2efce Mon Sep 17 00:00:00 2001 From: Cristhian Garcia Date: Tue, 29 Oct 2024 09:02:03 -0500 Subject: [PATCH] docs: update create next component version docstring --- openedx_learning/apps/authoring/components/api.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openedx_learning/apps/authoring/components/api.py b/openedx_learning/apps/authoring/components/api.py index f58dca6d..ace74fbb 100644 --- a/openedx_learning/apps/authoring/components/api.py +++ b/openedx_learning/apps/authoring/components/api.py @@ -147,6 +147,9 @@ def create_next_component_version( local path/key for a file, to ``Content.id`` or content bytes values. Using `None` for a value in this dict means to delete that key in the next version. + Make sure to wrap the function call on a atomic statement: + ``with transaction.atomic():`` + It is okay to mark entries for deletion that don't exist. For instance, if a version has ``a.txt`` and ``b.txt``, sending a ``content_to_replace`` value of ``{"a.txt": None, "c.txt": None}`` will remove ``a.txt`` from the next