You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by se...@apache.org on 2022/01/23 14:51:50 UTC
[incubator-ponymail-foal] branch master updated: More places where "id" needs to be dropped
This is an automated email from the ASF dual-hosted git repository.
sebb 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 9410b08 More places where "id" needs to be dropped
9410b08 is described below
commit 9410b08ac307f4575c525351d8dfaa213739d485
Author: Sebb <se...@apache.org>
AuthorDate: Sun Jan 23 14:51:38 2022 +0000
More places where "id" needs to be dropped
See #184
---
server/endpoints/mgmt.py | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/server/endpoints/mgmt.py b/server/endpoints/mgmt.py
index adc3c74..8811395 100644
--- a/server/endpoints/mgmt.py
+++ b/server/endpoints/mgmt.py
@@ -55,6 +55,8 @@ async def process(
assert isinstance(doc, str), "Document ID must be a string"
email = await plugins.messages.get_email(session, permalink=doc)
if email and isinstance(email, dict) and plugins.aaa.can_access_email(session, email):
+ if "id" in email: # id is not a valid property for mbox
+ del email["id"]
if server.config.ui.fully_delete and email["mid"] and email["dbid"]: # Full on GDPR blast?
await session.database.delete(
index=session.database.dbs.db_mbox, id=email["mid"],
@@ -78,6 +80,8 @@ async def process(
assert isinstance(doc, str), "Document ID must be a string"
email = await plugins.messages.get_email(session, permalink=doc)
if email and isinstance(email, dict) and plugins.aaa.can_access_email(session, email):
+ if "id" in email: # id is not a valid property for mbox
+ del email["id"]
email["deleted"] = True
await session.database.update(
index=session.database.dbs.db_mbox, body={"doc": email}, id=email["mid"],
@@ -93,6 +97,8 @@ async def process(
assert isinstance(doc, str), "Document ID must be a string"
email = await plugins.messages.get_email(session, permalink=doc)
if email and isinstance(email, dict) and plugins.aaa.can_access_email(session, email):
+ if "id" in email: # id is not a valid property for mbox
+ del email["id"]
email["deleted"] = False
await session.database.update(
index=session.database.dbs.db_mbox, body={"doc": email}, id=email["mid"],