Changeset - 9c90be87ae05
[Not reviewed]
beta
0 3 0
Marcin Kuzminski - 13 years ago 2012-09-07 17:53:14
marcin@python-works.com
fixed issue #560 require push ssl checkbox wasn't shown when option was enabled
3 files changed with 9 insertions and 2 deletions:
0 comments (0 inline, 0 general)
rhodecode/controllers/admin/settings.py
Show inline comments
 
@@ -48,12 +48,13 @@ from rhodecode.model.forms import UserFo
 
    ApplicationUiSettingsForm, ApplicationVisualisationForm
 
from rhodecode.model.scm import ScmModel
 
from rhodecode.model.user import UserModel
 
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__)
 

	
 

	
 
class SettingsController(BaseController):
 
    """REST Controller styled on the Atom Publishing Protocol"""
 
@@ -468,15 +469,17 @@ class SettingsController(BaseController)
 
        for each in ret:
 
            k = each.ui_key
 
            v = each.ui_value
 
            if k == '/':
 
                k = 'root_path'
 

	
 
            if k == 'push_ssl':
 
                v = str2bool(v)
 

	
 
            if k.find('.') != -1:
 
                k = k.replace('.', '_')
 

	
 
            if each.ui_section in ['hooks', 'extensions']:
 
                v = each.ui_active
 

	
 
            settings[each.ui_section + '_' + k] = v
 

	
 
        return settings
rhodecode/model/db.py
Show inline comments
 
@@ -275,12 +275,16 @@ class RhodeCodeUi(Base, BaseModel):
 
        new_ui.ui_active = True
 
        new_ui.ui_key = key
 
        new_ui.ui_value = val
 

	
 
        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'
 
    __table_args__ = (
 
        UniqueConstraint('username'), UniqueConstraint('email'),
 
        Index('u_username_idx', 'username'),
rhodecode/templates/admin/settings/settings.html
Show inline comments
 
@@ -183,13 +183,13 @@
 
             <div class="field">
 
                <div class="label label-checkbox">
 
                    <label>${_('Web')}:</label>
 
                </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>
 
				</div>
 
             </div>
 

	
0 comments (0 inline, 0 general)