Пример #1
0
    def reset_config(self):
        '''FIXME: This method is probably not doing what people would expect.
           It will reset the configuration to values cached when CKAN started.
           If these were coming from the database during startup, that's the
           ones that will get applied on reset, not the ones in the ini file.
           Only after restarting the server and having CKAN reset the values
           from the ini file (as the db ones are not there anymore) will these
           be used.
        '''

        if 'cancel' in request.params:
            h.redirect_to(controller='admin', action='config')

        if request.method == 'POST':
            #check against csrf attacks
            custom_base.csrf_check(self)
            # remove sys info items
            for item in self._get_config_form_items():
                name = item['name']
                model.delete_system_info(name)
            # reset to values in config
            app_globals.reset()
            h.redirect_to(controller='admin', action='config')

        return base.render('admin/confirm_reset.html')
Пример #2
0
 def post(self):
     # remove sys info items
     for item in _get_config_items():
         model.delete_system_info(item)
     # reset to values in config
     app_globals.reset()
     return h.redirect_to(u'admin.config')
Пример #3
0
def delete_global(key):
    model.delete_system_info(key)
    log.info('config `%s` deleted' % (key))
Пример #4
0
def delete_global(key):
    model.delete_system_info(key)
    log.info('config `%s` deleted' % (key))