def run(self, provider=None): if provider: data = superdesk.json.loads(provider) data.setdefault('_created', utcnow()) data.setdefault('_updated', utcnow()) data.setdefault('name', data['type']) db = superdesk.get_db() db['ingest_providers'].save(data) return data
def run(self, provider=None): if provider: data = superdesk.json.loads(provider) data.setdefault('name', data['type']) data.setdefault('source', data['type']) data.setdefault('days_to_keep', DAYS_TO_KEEP) db = superdesk.get_db() db['ingest_providers'].save(data) return data
def run(self, provider=None): if provider: try: data = {} data = superdesk.json.loads(provider) data.setdefault('name', data['type']) data.setdefault('source', data['type']) data.setdefault('content_expiry', INGEST_EXPIRY_MINUTES) db = superdesk.get_db() db['ingest_providers'].save(data) return data except Exception as ex: raise ProviderError.providerAddError(ex, data)
def run(self, provider=None): if provider: try: data = {} data = superdesk.json.loads(provider) data.setdefault('name', data['type']) data.setdefault('source', data['type']) data.setdefault('days_to_keep', DAYS_TO_KEEP) db = superdesk.get_db() db['ingest_providers'].save(data) return data except Exception as ex: raise ProviderError.providerAddError(ex, data)