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/29 17:17:55 UTC

[incubator-ponymail-foal] 01/02: Simplify: checking is done in messages plugin

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

commit dc45873a31019b217ecfb108ccba2bfe25f2a1b4
Author: Sebb <se...@apache.org>
AuthorDate: Sat Jan 29 17:17:37 2022 +0000

    Simplify: checking is done in messages plugin
---
 server/endpoints/source.py | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/server/endpoints/source.py b/server/endpoints/source.py
index 927107d..afd9d56 100644
--- a/server/endpoints/source.py
+++ b/server/endpoints/source.py
@@ -37,13 +37,12 @@ async def process(
     else: # Else assume permalink and look up the email based on that
         email = await plugins.messages.get_email(session, permalink=indata.get("id"))
 
-    if email and isinstance(email, dict) and not email.get("deleted"):
-        if plugins.aaa.can_access_email(session, email):
-            source = await plugins.messages.get_source(session, permalink=email["dbid"])
-            if source:
-                return aiohttp.web.Response(
-                    headers={"Content-Type": "text/plain"}, status=200, text=source["_source"]["source"],
-                )
+    if email:
+        source = await plugins.messages.get_source(session, permalink=email["dbid"])
+        if source:
+            return aiohttp.web.Response(
+                headers={"Content-Type": "text/plain"}, status=200, text=source["_source"]["source"],
+            )
     return aiohttp.web.Response(headers={}, status=404, text="Email not found")