def create_new_document(self, repository_url, jdata = {}): d = Document() dups = self.agent_get_existing(self.AGENT_NAME, self.AGENT_VERSION, repository_url) if dups: return None # to do - Handle IN-PROGRESS dups that are now explicitely not included in agent_get_existing() # d.agent_state = STATE_DUP # d.agent_dup = dups[0] # logger.info("Duplicate found %s - %s" % (thesis_url, dups[0])) # d.save() # continue d.agent_name = self.AGENT_NAME d.agent_version = self.AGENT_VERSION d.agent_repository_url = repository_url d.agent_date = timezone.now() d.status = STATE_WAITING # d.agent_json_data = json.dumps(jdata) d.save() return d