You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by tv...@apache.org on 2013/11/08 05:21:13 UTC

[3/6] git commit: [#6694] ticket:461 Check that both users have email

[#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/9dc9a361
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/9dc9a361
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/9dc9a361

Branch: refs/heads/tv/6694
Commit: 9dc9a3610447a370c3ec3b5ad8ce9cba46072184
Parents: 6b75fed
Author: Igor Bondarenko <je...@gmail.com>
Authored: Mon Nov 4 08:31:52 2013 +0000
Committer: Igor Bondarenko <je...@gmail.com>
Committed: Mon Nov 4 08:31:52 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/9dc9a361/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/9dc9a361/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 5bf8d05..76246c7 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']