allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hei...@apache.org
Subject [10/14] allura git commit: [#6107] ticket:748 Check if email posting is allowed in base implementation of email_address
Date Fri, 15 May 2015 16:07:50 GMT
[#6107] ticket:748 Check if email posting is allowed in base implementation of email_address


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/1ebfe019
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/1ebfe019
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/1ebfe019

Branch: refs/heads/master
Commit: 1ebfe019e7f94fd23fd4d740afe0d51487bdfda1
Parents: a334bfa
Author: Aleksey 'LXj' Alekseyev <gotletter@gmail.com>
Authored: Thu Apr 30 21:53:32 2015 +0300
Committer: Aleksey 'LXj' Alekseyev <gotletter@gmail.com>
Committed: Thu Apr 30 21:53:32 2015 +0300

----------------------------------------------------------------------
 Allura/allura/app.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/1ebfe019/Allura/allura/app.py
----------------------------------------------------------------------
diff --git a/Allura/allura/app.py b/Allura/allura/app.py
index 4e1ed5d..3e226db 100644
--- a/Allura/allura/app.py
+++ b/Allura/allura/app.py
@@ -25,6 +25,7 @@ from xml.etree import ElementTree as ET
 import pkg_resources
 from tg import expose, redirect, flash, validate
 from tg.decorators import without_trailing_slash
+from tg import config as tg_config
 from pylons import request, app_globals as g, tmpl_context as c
 from paste.deploy.converters import asbool, asint
 from bson import ObjectId
@@ -309,8 +310,11 @@ class Application(object):
 
         Assumes self.url returns a url path without domain, starting with '/'
         """
-        parts = list(reversed(self.url[1:-1].split('/')))
-        return '%s@%s%s' % (parts[0], '.'.join(parts[1:]), config.common_suffix)
+        if self.config.options.get('AllowEmailPosting', True):
+            parts = list(reversed(self.url[1:-1].split('/')))
+            return '%s@%s%s' % (parts[0], '.'.join(parts[1:]), config.common_suffix)
+        else:
+            return tg_config.get('forgemail.return_path')
 
     @property
     def acl(self):


Mime
View raw message