(trans_id=None)
| 490 | |
| 491 | |
| 492 | def delete_tool_data(trans_id=None): |
| 493 | try: |
| 494 | if trans_id: |
| 495 | results = db.session \ |
| 496 | .query(ApplicationState) \ |
| 497 | .filter(ApplicationState.uid == current_user.id, |
| 498 | ApplicationState.id == trans_id) \ |
| 499 | .all() |
| 500 | else: |
| 501 | results = db.session \ |
| 502 | .query(ApplicationState) \ |
| 503 | .filter(ApplicationState.uid == current_user.id) \ |
| 504 | .all() |
| 505 | for result in results: |
| 506 | db.session.delete(result) |
| 507 | db.session.commit() |
| 508 | return True, 'Success' |
| 509 | except Exception as e: |
| 510 | db.session.rollback() |
| 511 | return False, str(e) |
| 512 | |
| 513 | |
| 514 | def compute_md5_hash_file(file_path, chunk_size=8192): |
no test coverage detected