incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject git commit: [#7109] use user.url() instead of constructing /u/username manually; add sender's name
Date Wed, 29 Jan 2014 22:04:32 GMT
Updated Branches:
  refs/heads/master 036905c23 -> 782f0c05e


[#7109] use user.url() instead of constructing /u/username manually; add sender's name

Using 'user' variable instead of 'username' also allows for more flexibility with
anyone that overrides this template for customizations.


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

Branch: refs/heads/master
Commit: 782f0c05e618e9d5ac164a221b53d01a3e985f3b
Parents: 036905c
Author: Dave Brondsema <dbrondsema@slashdotmedia.com>
Authored: Tue Jan 28 16:26:18 2014 +0000
Committer: Cory Johns <cjohns@slashdotmedia.com>
Committed: Wed Jan 29 22:04:15 2014 +0000

----------------------------------------------------------------------
 Allura/allura/ext/user_profile/templates/message.html | 2 +-
 Allura/allura/model/auth.py                           | 6 +++++-
 Allura/allura/tests/functional/test_user_profile.py   | 4 ++--
 3 files changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/782f0c05/Allura/allura/ext/user_profile/templates/message.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/user_profile/templates/message.html b/Allura/allura/ext/user_profile/templates/message.html
index f06e1d4..d354b4d 100644
--- a/Allura/allura/ext/user_profile/templates/message.html
+++ b/Allura/allura/ext/user_profile/templates/message.html
@@ -20,5 +20,5 @@
 
 ---
 
-This message was sent to you via the {{site_name}} web mail form.  You may reply to this
message directly, or at {{base_url}}/u/{{username}}/profile/send_message
+This message was sent to you via the {{site_name}} web mail form.  You may reply to this
message directly, or send a message to {{user.display_name or user.username}} at {{base_url}}{{user.url()}}profile/send_message
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/782f0c05/Allura/allura/model/auth.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/auth.py b/Allura/allura/model/auth.py
index bac0568..542b1f6 100644
--- a/Allura/allura/model/auth.py
+++ b/Allura/allura/model/auth.py
@@ -415,7 +415,7 @@ class User(MappedClass, ActivityNode, ActivityObject):
             'message_text': message,
             'site_name': config['site_name'],
             'base_url': config['base_url'],
-            'username': c.user.username,
+            'user': c.user,
         }
         allura.tasks.mail_tasks.sendsimplemail.post(
             toaddr=user.get_pref('email_address'),
@@ -588,6 +588,10 @@ class User(MappedClass, ActivityNode, ActivityObject):
         return retval
 
     def url(self):
+        '''
+        Return the URL (relative to root domain) for this user's user-project.
+        This includes any special handling via the Auth Provider to determine the proper
user-project name
+        '''
         return '/%s/' % plugin.AuthenticationProvider.get(request).user_project_shortname(self)
 
     @memoize

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/782f0c05/Allura/allura/tests/functional/test_user_profile.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_user_profile.py b/Allura/allura/tests/functional/test_user_profile.py
index 6aa4629..6f01e6a 100644
--- a/Allura/allura/tests/functional/test_user_profile.py
+++ b/Allura/allura/tests/functional/test_user_profile.py
@@ -81,7 +81,7 @@ class TestUserProfile(TestController):
 
         sendsimplemail.post.assert_called_once_with(
             cc=User.by_username('test-admin').get_pref('email_address'),
-            text=u'test message\n\n---\n\nThis message was sent to you via the Allura web
mail form.  You may reply to this message directly, or at http://localhost/u/test-admin/profile/send_message\n',
+            text=u'test message\n\n---\n\nThis message was sent to you via the Allura web
mail form.  You may reply to this message directly, or send a message to Test Admin at http://localhost/u/test-admin/profile/send_message\n',
             toaddr=User.by_username('test-user').get_pref('email_address'),
             fromaddr=User.by_username('test-admin').get_pref('email_address'),
             reply_to=User.by_username('test-admin').get_pref('email_address'),
@@ -94,7 +94,7 @@ class TestUserProfile(TestController):
 
         sendsimplemail.post.assert_called_once_with(
             cc=None,
-            text=u'test message\n\n---\n\nThis message was sent to you via the Allura web
mail form.  You may reply to this message directly, or at http://localhost/u/test-admin/profile/send_message\n',
+            text=u'test message\n\n---\n\nThis message was sent to you via the Allura web
mail form.  You may reply to this message directly, or send a message to Test Admin at http://localhost/u/test-admin/profile/send_message\n',
             toaddr=User.by_username('test-user').get_pref('email_address'),
             fromaddr=User.by_username('test-admin').get_pref('email_address'),
             reply_to=User.by_username('test-admin').get_pref('email_address'),


Mime
View raw message