allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tvansteenbu...@apache.org
Subject [3/6] git commit: [#6694] ticket:461 Check that both users have email
Date Fri, 08 Nov 2013 04:45:48 GMT
[#6694] ticket:461 Check that both users have email


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

Branch: refs/heads/master
Commit: 7209d5fdce8ad384123bc41de93d6db108c37d75
Parents: 26d01ed
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Mon Nov 4 08:31:52 2013 +0000
Committer: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Committed: Fri Nov 8 04:30:15 2013 +0000

----------------------------------------------------------------------
 Allura/allura/ext/user_profile/templates/send_message.html | 2 +-
 Allura/allura/ext/user_profile/user_main.py                | 6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/7209d5fd/Allura/allura/ext/user_profile/templates/send_message.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/user_profile/templates/send_message.html b/Allura/allura/ext/user_profile/templates/send_message.html
index 705cce2..44b64b0 100644
--- a/Allura/allura/ext/user_profile/templates/send_message.html
+++ b/Allura/allura/ext/user_profile/templates/send_message.html
@@ -34,7 +34,7 @@
 {% block content %}
     <div class="content">
     {%if not expire_time%}
-            {{c.form.display(method = 'POST', action='send_user_message', user=user)}}
+        {{c.form.display(method = 'POST', action='send_user_message', user=user)}}
     {% else %}
         <h2>Sorry, you can send an email after {{expire_time}}</h2>
     {% endif %}

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/7209d5fd/Allura/allura/ext/user_profile/user_main.py
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/user_profile/user_main.py b/Allura/allura/ext/user_profile/user_main.py
index 3832a7f..df5d8cb 100644
--- a/Allura/allura/ext/user_profile/user_main.py
+++ b/Allura/allura/ext/user_profile/user_main.py
@@ -117,7 +117,8 @@ class UserProfileController(BaseController, FeedController):
     @expose('jinja:allura.ext.user_profile:templates/send_message.html')
     def send_message(self):
         user = c.project.user_project_of
-        if not (user and c.user.get_pref('email_address')):
+        both_have_emails = user and user.get_pref('email_address') and c.user.get_pref('email_address')
+        if not both_have_emails:
             raise exc.HTTPNotFound()
 
         time_interval = config['user_message.time_interval']
@@ -138,7 +139,8 @@ class UserProfileController(BaseController, FeedController):
                    message=validators.NotEmpty))
     def send_user_message(self, subject='', message='', cc=None):
         user = c.project.user_project_of
-        if not (user and c.user.get_pref('email_address')):
+        both_have_emails = user and user.get_pref('email_address') and c.user.get_pref('email_address')
+        if not both_have_emails:
             raise exc.HTTPNotFound()
 
         time_interval = config['user_message.time_interval']


Mime
View raw message