()
| 17525 | |
| 17526 | if is_encrypted_file(ap): |
| 17527 | gen = aesgcm_decrypt_generator(ap) |
| 17528 | resp = Response(gen, mimetype=mime) |
| 17529 | resp.headers["Content-Disposition"] = f'attachment; filename="{filename}"' |
| 17530 | else: |
| 17531 | from flask import send_file |
| 17532 | resp = send_file( |
| 17533 | ap, |
| 17534 | mimetype=mime, |
| 17535 | as_attachment=True, |
| 17536 | download_name=filename, |
| 17537 | conditional=True, |
| 17538 | max_age=0, |
| 17539 | ) |
| 17540 | |
| 17541 | resp.headers["Cache-Control"] = "no-store" |
| 17542 | return resp |
| 17543 | except Exception: |
| 17544 | flash("Download failed.") |
| 17545 | return redirect(url_for("admin_user_files", username=username)) |
| 17546 | |
| 17547 | # --------------------------- |
| 17548 | # Admin approval worker (Terminal prompt) |
| 17549 | # --------------------------- |
| 17550 | |
| 17551 | |
| 17552 | PENDING_QUEUE = queue.Queue() |
| 17553 | |
| 17554 | def pending_requests_bootstrap(): |
| 17555 | """pending_requests_bootstrap. |
| 17556 | |
| 17557 | Route handler or application helper. |
| 17558 | |
| 17559 | This docstring was expanded to make future maintenance easier. |
| 17560 | |
| 17561 | Returns: |
| 17562 | Varies. |
| 17563 | """ |
| 17564 | try: |
nothing calls this directly
no test coverage detected