changeset 2821:9c90be87ae05 beta

fixed issue #560 require push ssl checkbox wasn't shown when option was enabled
author Marcin Kuzminski <marcin@python-works.com>
date Fri, 07 Sep 2012 17:53:14 +0200
parents c0cc8f8a71b0
children 1670ee0aded7
files rhodecode/controllers/admin/settings.py rhodecode/model/db.py rhodecode/templates/admin/settings/settings.html
diffstat 3 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/controllers/admin/settings.py	Fri Sep 07 02:20:02 2012 +0200
+++ b/rhodecode/controllers/admin/settings.py	Fri Sep 07 17:53:14 2012 +0200
@@ -51,6 +51,7 @@
 from rhodecode.model.db import User
 from rhodecode.model.notification import EmailNotificationModel
 from rhodecode.model.meta import Session
+from rhodecode.lib.utils2 import str2bool
 
 log = logging.getLogger(__name__)
 
@@ -471,6 +472,9 @@
             if k == '/':
                 k = 'root_path'
 
+            if k == 'push_ssl':
+                v = str2bool(v)
+
             if k.find('.') != -1:
                 k = k.replace('.', '_')
 
@@ -478,5 +482,4 @@
                 v = each.ui_active
 
             settings[each.ui_section + '_' + k] = v
-
         return settings
--- a/rhodecode/model/db.py	Fri Sep 07 02:20:02 2012 +0200
+++ b/rhodecode/model/db.py	Fri Sep 07 17:53:14 2012 +0200
@@ -278,6 +278,10 @@
 
         Session().add(new_ui)
 
+    def __repr__(self):
+        return '<DB:%s[%s:%s]>' % (self.__class__.__name__, self.ui_key,
+                                   self.ui_value)
+
 
 class User(Base, BaseModel):
     __tablename__ = 'users'
--- a/rhodecode/templates/admin/settings/settings.html	Fri Sep 07 02:20:02 2012 +0200
+++ b/rhodecode/templates/admin/settings/settings.html	Fri Sep 07 17:53:14 2012 +0200
@@ -186,7 +186,7 @@
                 </div>
                 <div class="checkboxes">
 					<div class="checkbox">
-						${h.checkbox('web_push_ssl','true')}
+						${h.checkbox('web_push_ssl', 'True')}
 						<label for="web_push_ssl">${_('require ssl for vcs operations')}</label>
 					</div>
                     <span class="help-block">${_('RhodeCode will require SSL for pushing or pulling. If SSL is missing it will return HTTP Error 406: Not Acceptable')}</span>