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 d3389c91f76c5f0cd04633b5bb49b1873fb3c22e
Author: Daniel Gruno <[email protected]>
AuthorDate: Mon Mar 29 14:52:48 2021 +0200

    PEP8 linting
---
 server/endpoints/mgmt.py | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/server/endpoints/mgmt.py b/server/endpoints/mgmt.py
index a4d8f81..f81394a 100644
--- a/server/endpoints/mgmt.py
+++ b/server/endpoints/mgmt.py
@@ -27,29 +27,25 @@ import time
 
 
 async def process(
-    server: plugins.server.BaseServer,
-    session: plugins.session.SessionObject,
-    indata: dict,
+    server: plugins.server.BaseServer, session: plugins.session.SessionObject, 
indata: dict,
 ) -> typing.Optional[dict]:
-    action = indata.get('action')
-    docs = indata.get('documents', [])
-    doc = indata.get('document')
+    action = indata.get("action")
+    docs = indata.get("documents", [])
+    doc = indata.get("document")
     if not docs and doc:
         docs = [doc]
     if not session.credentials.admin or not server.config.ui.mgmt_enabled:
         return aiohttp.web.Response(headers={}, status=403, text="You need 
administrative access to use this feature.")
 
     # Deleting/hiding a document?
-    if action == 'delete':
+    if action == "delete":
         delcount = 0
         for doc in docs:
             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
+                email["deleted"] = True
                 await session.database.index(
-                    index=session.database.dbs.mbox,
-                    body=email,
-                    id=email['id'],
+                    index=session.database.dbs.mbox, body=email, 
id=email["id"],
                 )
                 lid = email.get("list_raw")
                 await session.database.index(
@@ -62,7 +58,7 @@ async def process(
                         "target": doc,
                         "lid": lid,
                         "log": f"Removed email {doc} from {lid} archives",
-                    }
+                    },
                 )
                 delcount += 1
         return aiohttp.web.Response(headers={}, status=200, text=f"Removed 
{delcount} emails from archives.")

Reply via email to