def cleanup_settings(self, request, pylonsapp):
        ui_id = RhodeCodeUi.ui_id
        original_ids = list(
            r.ui_id for r in RhodeCodeUi.query().values(ui_id))

        @request.addfinalizer
        def cleanup():
            RhodeCodeUi.query().filter(
                ui_id.notin_(original_ids)).delete(False)
Exemple #2
0
    def _get_hg_ui_settings(self):
        ret = RhodeCodeUi.query().all()

        if not ret:
            raise Exception('Could not get application ui settings !')
        settings = {}
        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
Exemple #3
0
    def _get_hg_ui_settings(self):
        ret = RhodeCodeUi.query().all()

        if not ret:
            raise Exception('Could not get application ui settings !')
        settings = {}
        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
 def cleanup():
     RhodeCodeUi.query().filter(
         ui_id.notin_(original_ids)).delete(False)