allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [2/2] git commit: [#4805] ticket:232 don't limit the extra template data
Date Tue, 11 Dec 2012 20:16:30 GMT
[#4805] ticket:232 don't limit the extra template data


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

Branch: refs/heads/master
Commit: 5d1ffe0934623170331345aa2fac2ed010987fdf
Parents: aec4edf
Author: Yuriy Arhipov <yuriyarhipovua@yandex.ru>
Authored: Tue Dec 11 13:45:11 2012 +0400
Committer: Yuriy Arhipov <yuriyarhipovua@yandex.ru>
Committed: Tue Dec 11 14:36:43 2012 +0400

----------------------------------------------------------------------
 Allura/allura/model/notification.py          |    5 ++---
 Allura/allura/tests/model/test_discussion.py |    2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/5d1ffe09/Allura/allura/model/notification.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/notification.py b/Allura/allura/model/notification.py
index 9269c61..84c4746 100644
--- a/Allura/allura/model/notification.py
+++ b/Allura/allura/model/notification.py
@@ -168,9 +168,8 @@ class Notification(MappedClass):
             d['text'] = ''
         try:
             ''' Add addional text to the notification e-mail based on the artifact type '''
-            if artifact.__mongometa__.name in ['forum', 'ticket']:
-                template = cls.view.get_template('mail/' + artifact.type_s + '.txt')
-                d['text'] += template.render(dict(c=c, g=g, config=config, data=artifact,
post=post, h=h))
+            template = cls.view.get_template('mail/' + artifact.type_s + '.txt')
+            d['text'] += template.render(dict(c=c, g=g, config=config, data=artifact, post=post,
h=h))
         except jinja2.TemplateNotFound:
             pass
         except:

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/5d1ffe09/Allura/allura/tests/model/test_discussion.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/model/test_discussion.py b/Allura/allura/tests/model/test_discussion.py
index 3124320..298c554 100644
--- a/Allura/allura/tests/model/test_discussion.py
+++ b/Allura/allura/tests/model/test_discussion.py
@@ -185,7 +185,7 @@ def test_attachment_methods():
     p = t.post(text=u'test message', forum= None, subject= '', file_info=fs)
     ThreadLocalORMSession.flush_all()
     n = M.Notification.query.get(subject=u'[test:wiki] Test comment notification')
-    assert_equals(u'test message\n\n\nAttachment: fake.txt (37 Bytes; text/plain)', n.text)
+    assert '\nAttachment: fake.txt (37 Bytes; text/plain)' in n.text
 
 @with_setup(setUp, tearDown)
 def test_discussion_delete():


Mime
View raw message