def create(self, docs, **kwargs): for doc in docs: if doc.get('remove_first'): drop_elastic(superdesk.app) drop_mongo(superdesk.app) user = get_resource_service('users').find_one(username=get_default_user()['username'], req=None) if not user: get_resource_service('users').post([get_default_user()]) prepopulate_data(doc.get('profile') + '.json', get_default_user()) return ['OK']
def create(self, docs, **kwargs): for doc in docs: if doc.get("remove_first"): drop_elastic(superdesk.app) drop_mongo(superdesk.app) user = get_resource_service("users").find_one(username=get_default_user()["username"], req=None) if not user: get_resource_service("users").post([get_default_user()]) prepopulate_data(doc.get("profile") + ".json", get_default_user()) return ["OK"]
def create(self, docs, **kwargs): for doc in docs: if doc.get('remove_first'): drop_elastic(superdesk.app) drop_mongo(superdesk.app) user = get_resource_service('users').find_one( username=get_default_user()['username'], req=None) if not user: get_resource_service('users').post([get_default_user()]) prepopulate_data(doc.get('profile') + '.json', get_default_user()) return ['OK']
def create(self, docs, **kwargs): for doc in docs: if doc.get('remove_first'): drop_mongo(superdesk.app) drop_elastic(superdesk.app) app.data.init_elastic(superdesk.app) user = get_resource_service('users').find_one(username=get_default_user()['username'], req=None) if not user: get_resource_service('users').post([get_default_user()]) prepopulate_data(doc.get('profile') + '.json', get_default_user()) if app.config.get('SUPERDESK_TESTING'): for provider in ['paimg', 'aapmm']: if provider not in allowed_search_providers: register_search_provider(provider, provider) return ['OK']
def create(self, docs, **kwargs): for doc in docs: if doc.get('remove_first'): drop_elastic(superdesk.app) drop_mongo(superdesk.app) # call the create index with settings superdesk.app.data.elastic.create_index( superdesk.app.config['ELASTICSEARCH_INDEX'], superdesk.app.config['ELASTICSEARCH_SETTINGS'] ) superdesk.app.data.elastic.put_mapping(superdesk.app) user = get_resource_service('users').find_one(username=get_default_user()['username'], req=None) if not user: get_resource_service('users').post([get_default_user()]) prepopulate_data(doc.get('profile') + '.json', get_default_user()) return ['OK']
def create(self, docs, **kwargs): for doc in docs: if doc.get('remove_first'): drop_elastic(superdesk.app) drop_mongo(superdesk.app) # call the create index with settings superdesk.app.data.elastic.create_index( superdesk.app.config['ELASTICSEARCH_INDEX'], superdesk.app.config['ELASTICSEARCH_SETTINGS']) superdesk.app.data.elastic.put_mapping(superdesk.app) user = get_resource_service('users').find_one( username=get_default_user()['username'], req=None) if not user: get_resource_service('users').post([get_default_user()]) prepopulate_data(doc.get('profile') + '.json', get_default_user()) return ['OK']