This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git


The following commit(s) were added to refs/heads/master by this push:
     new b9bc53b  use updates instead of index, to avoid field resets
     new 5a14adb  Merge branch 'master' of 
github.com:apache/incubator-ponymail-foal
b9bc53b is described below

commit b9bc53bfe1b4b7bcdea5a036e774db72b0d43f1d
Author: Daniel Gruno <[email protected]>
AuthorDate: Sun Sep 26 18:43:07 2021 -0500

    use updates instead of index, to avoid field resets
---
 server/endpoints/mgmt.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/server/endpoints/mgmt.py b/server/endpoints/mgmt.py
index af031f7..0cef291 100644
--- a/server/endpoints/mgmt.py
+++ b/server/endpoints/mgmt.py
@@ -102,8 +102,8 @@ async def process(
             email["body"] = new_body
 
             # Save edited email
-            await session.database.index(
-                index=session.database.dbs.mbox, body=email, id=email["id"],
+            await session.database.update(
+                index=session.database.dbs.mbox, body={"doc": email}, 
id=email["id"],
             )
 
             # Fetch source, mark as deleted (modified) and save
@@ -112,8 +112,8 @@ async def process(
             if source:
                 source = source["_source"]
                 source["deleted"] = True
-                await session.database.index(
-                    index=session.database.dbs.source, body=source, 
id=email["id"],
+                await session.database.update(
+                    index=session.database.dbs.source, body={"doc": email}, 
id=email["id"],
                 )
 
             await plugins.auditlog.add_entry(session, action="edit", 
target=doc, lid=lid,

Reply via email to