allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [1/2] git commit: [#7452] ticket:604 Fix template for so that it was impossible to choose mail is not verified and controller
Date Wed, 02 Jul 2014 21:47:15 GMT
Repository: allura
Updated Branches:
  refs/heads/master 22c610888 -> 18cff87f4


[#7452] ticket:604  Fix template for so that it was impossible to choose mail is not verified
and controller


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

Branch: refs/heads/master
Commit: 748684d767e642f9b9c8de2eb13a1af14dbdf16c
Parents: 22c6108
Author: tramzzz <steh44@gmail.com>
Authored: Thu Jun 26 18:10:54 2014 +0300
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Wed Jul 2 21:01:07 2014 +0000

----------------------------------------------------------------------
 Allura/allura/controllers/auth.py           | 4 +++-
 Allura/allura/templates/user_prefs.html     | 6 +++++-
 Allura/allura/tests/functional/test_auth.py | 4 ++--
 3 files changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/748684d7/Allura/allura/controllers/auth.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/auth.py b/Allura/allura/controllers/auth.py
index 7c78a9e..ea17017 100644
--- a/Allura/allura/controllers/auth.py
+++ b/Allura/allura/controllers/auth.py
@@ -416,7 +416,9 @@ class PreferencesController(BaseController):
                 else:
                     flash('Email address %s is invalid' % new_addr['addr'], 'error')
             if not primary_addr and not c.user.get_pref('email_address') and c.user.email_addresses:
-                primary_addr = c.user.email_addresses[0]
+                obj = c.user.address_object(c.user.email_addresses[0])
+                if obj.confirmed:
+                    primary_addr = c.user.email_addresses[0]
             if primary_addr:
                 c.user.set_pref('email_address', primary_addr)
             for k, v in preferences.iteritems():

http://git-wip-us.apache.org/repos/asf/allura/blob/748684d7/Allura/allura/templates/user_prefs.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/user_prefs.html b/Allura/allura/templates/user_prefs.html
index 4d86591..d921889 100644
--- a/Allura/allura/templates/user_prefs.html
+++ b/Allura/allura/templates/user_prefs.html
@@ -81,7 +81,11 @@
             {% for a in c.user.email_addresses %}
             <tr>
               {% set obj = c.user.address_object(a) %}
-              <td>{{lib.radio_button('primary_addr', None, a, c.user.preferences.email_address)}}</td>
+              {% if obj.confirmed %}
+                <td>{{lib.radio_button('primary_addr', None, a, c.user.preferences.email_address)}}</td>
+              {% else %} 
+                <td> <input type="radio" disabled="disabled"></td>
+              {% endif %}
               <td>{{a}}</td>
               {% if obj %}
               <td>

http://git-wip-us.apache.org/repos/asf/allura/blob/748684d7/Allura/allura/tests/functional/test_auth.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/functional/test_auth.py b/Allura/allura/tests/functional/test_auth.py
index 6293c83..4270049 100644
--- a/Allura/allura/tests/functional/test_auth.py
+++ b/Allura/allura/tests/functional/test_auth.py
@@ -113,9 +113,9 @@ class TestAuth(TestController):
             extra_environ=dict(username='test-admin'))
         r = self.app.get('/auth/preferences/')
         assert 'test-admin@users.localhost' not in r
-        # preferred address has changed to remaining address
+        # preferred address has not change if not varifucated
         assert_equal(M.User.query.get(username='test-admin').get_pref('email_address'),
-                     'test@example.com')
+                     None)
 
     @td.with_user_project('test-admin')
     def test_prefs_subscriptions(self):


Mime
View raw message