You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by hu...@apache.org on 2021/03/31 12:01:25 UTC

[incubator-ponymail-foal] 01/14: assert doc ID is string

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

commit 5665ef6572837178714e35b524bd978d1978a67d
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Wed Mar 31 11:01:32 2021 +0200

    assert doc ID is string
---
 server/endpoints/mgmt.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/server/endpoints/mgmt.py b/server/endpoints/mgmt.py
index fcc9f02..b93e869 100644
--- a/server/endpoints/mgmt.py
+++ b/server/endpoints/mgmt.py
@@ -41,6 +41,7 @@ async def process(
     if action == "delete":
         delcount = 0
         for doc in docs:
+            assert isinstance(doc, str), "Document ID must be a string"
             email = await plugins.mbox.get_email(session, permalink=doc)
             if email and isinstance(email, dict) and plugins.aaa.can_access_email(session, email):
                 email["deleted"] = True