Issue Number | 4572 |
---|---|
Summary | Doc class doesn't handle deletion of documents with incoming links correctly |
Created | 2019-02-13 17:12:25 |
Issue Type | Bug |
Submitted By | Kline, Bob (NIH/NCI) [C] |
Assigned To | Kline, Bob (NIH/NCI) [C] |
Status | Closed |
Resolved | 2019-06-22 11:12:42 |
Resolution | Fixed |
Path | /home/bkline/backups/jira/ocecdr/issue.240198 |
Here's the patch to fix the two bugs.
-r ./cdrapi/docs.py /c/cdr/lib/Python/cdrapi/docs.py
diff 2425c2425
< doc = Doc(id=doc_id)
---
> doc = Doc(self.session, id=doc_id)
2437,2439c2437,2441
< delete = "DELETE FROM {} WHERE source_doc = ?"
< for table in ("link_net", "link_fragment"):
< sql = delete.format(table)
---
> delete_sql = (
> "DELETE FROM link_fragment WHERE doc_id = ?",
> "DELETE FROM link_net WHERE target_doc = ?"
> )
> for sql in delete_sql:
Fixed on DEV.
Elapsed: 0:00:00.001452