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')
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')
def delete_global(key): model.delete_system_info(key) log.info('config `%s` deleted' % (key))