()
| 7386 | if route == '/api/dedsec/run': |
| 7387 | job = run_dedsec_script(payload.get('path')) |
| 7388 | send_json(self, 200, {'ok': True, 'session': job}) |
| 7389 | return |
| 7390 | if route == '/api/settings/action': |
| 7391 | result = run_settings_action(payload.get('action'), payload) |
| 7392 | if isinstance(result, dict) and 'id' not in result and 'session' not in result: |
| 7393 | send_json(self, 200, {'ok': True, **result}) |
| 7394 | else: |
| 7395 | send_json(self, 200, {'ok': True, 'session': result}) |
| 7396 | return |
| 7397 | send_json(self, 404, {'ok': False, 'error': 'Unknown POST route: ' + route}) |
| 7398 | except Exception as exc: |
| 7399 | send_json(self, 400, {'ok': False, 'error': str(exc)}) |
| 7400 | |
| 7401 |
no test coverage detected