allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hei...@apache.org
Subject [05/14] allura git commit: [#6107] ticket:748 Use common noreply@ address
Date Fri, 15 May 2015 16:07:45 GMT
[#6107] ticket:748 Use common noreply@ address


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

Branch: refs/heads/master
Commit: b0754759b1ba5f4441e3212fd6a7e37bff9dc3b3
Parents: bb39025
Author: Aleksey 'LXj' Alekseyev <gotletter@gmail.com>
Authored: Mon Apr 27 20:00:28 2015 +0300
Committer: Igor Bondarenko <jetmind2@gmail.com>
Committed: Wed Apr 29 09:40:23 2015 +0000

----------------------------------------------------------------------
 ForgeDiscussion/forgediscussion/model/forum.py | 10 ++++++----
 ForgeTracker/forgetracker/model/ticket.py      |  9 ++++-----
 ForgeWiki/forgewiki/model/wiki.py              | 11 ++++++-----
 3 files changed, 16 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/b0754759/ForgeDiscussion/forgediscussion/model/forum.py
----------------------------------------------------------------------
diff --git a/ForgeDiscussion/forgediscussion/model/forum.py b/ForgeDiscussion/forgediscussion/model/forum.py
index d255c47..d4ad197 100644
--- a/ForgeDiscussion/forgediscussion/model/forum.py
+++ b/ForgeDiscussion/forgediscussion/model/forum.py
@@ -25,6 +25,8 @@ from ming import schema
 from ming.utils import LazyProperty
 from ming.orm import FieldProperty, RelationProperty, ForeignIdProperty, Mapper
 
+from tg import config as tg_config
+
 from allura import model as M
 from allura.model.notification import MailFooter
 from allura.lib import utils
@@ -77,13 +79,13 @@ class Forum(M.Discussion):
 
     @property
     def email_address(self):
-        domain = '.'.join(
-            reversed(self.app.url[1:-1].split('/'))).replace('_', '-')
         if c.app.config.options.get('AllowEmailPosting', True):
+            domain = '.'.join(
+                reversed(self.app.url[1:-1].split('/'))).replace('_', '-')
             local_part = self.shortname.replace('/', '.')
+            return '%s@%s%s' % (local_part, domain, config.common_suffix)
         else:
-            local_part = 'noreply'
-        return '%s@%s%s' % (local_part, domain, config.common_suffix)
+            return tg_config.get('forgemail.return_path')
 
     @LazyProperty
     def announcements(self):

http://git-wip-us.apache.org/repos/asf/allura/blob/b0754759/ForgeTracker/forgetracker/model/ticket.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/model/ticket.py b/ForgeTracker/forgetracker/model/ticket.py
index e22a2b5..fdab276 100644
--- a/ForgeTracker/forgetracker/model/ticket.py
+++ b/ForgeTracker/forgetracker/model/ticket.py
@@ -762,13 +762,12 @@ class Ticket(VersionedArtifact, ActivityObject, VotableArtifact):
 
     @property
     def email_address(self):
-        domain = '.'.join(
-            reversed(self.app.url[1:-1].split('/'))).replace('_', '-')
         if c.app.config.options.get('AllowEmailPosting', True):
-            local_part = self.ticket_num
+            domain = '.'.join(
+                reversed(self.app.url[1:-1].split('/'))).replace('_', '-')
+            return '%s@%s%s' % (self.ticket_num, domain, config.common_suffix)
         else:
-            local_part = 'noreply'
-        return '%s@%s%s' % (local_part, domain, config.common_suffix)
+            return tg_config.get('forgemail.return_path')
 
     @property
     def email_subject(self):

http://git-wip-us.apache.org/repos/asf/allura/blob/b0754759/ForgeWiki/forgewiki/model/wiki.py
----------------------------------------------------------------------
diff --git a/ForgeWiki/forgewiki/model/wiki.py b/ForgeWiki/forgewiki/model/wiki.py
index 79bd698..827a104 100644
--- a/ForgeWiki/forgewiki/model/wiki.py
+++ b/ForgeWiki/forgewiki/model/wiki.py
@@ -25,6 +25,8 @@ from ming import schema
 from ming.orm import FieldProperty, ForeignIdProperty, Mapper, session
 from ming.orm.declarative import MappedClass
 
+from tg import config as tg_config
+
 from allura.model import (
     VersionedArtifact,
     Snapshot,
@@ -158,13 +160,12 @@ class Page(VersionedArtifact, ActivityObject):
 
     @property
     def email_address(self):
-        domain = '.'.join(
-            reversed(self.app.url[1:-1].split('/'))).replace('_', '-')
         if context.app.config.options.get('AllowEmailPosting', True):
-            local_part = self.title.replace('/', '.')
+            domain = '.'.join(
+                reversed(self.app.url[1:-1].split('/'))).replace('_', '-')
+            return '%s@%s%s' % (self.title.replace('/', '.'), domain, config.common_suffix)
         else:
-            local_part = 'noreply'
-        return '%s@%s%s' % (local_part, domain, config.common_suffix)
+            return tg_config.get('forgemail.return_path')
 
     @property
     def email_subject(self):


Mime
View raw message