(cert_path: str, key_path: str, san_hosts: list[str])
| 17071 | cur = conn.cursor() |
| 17072 | cur.execute(""" |
| 17073 | INSERT INTO profiler_entries(owner, first_enc, last_enc, info_enc, optional_enc, created_at, updated_at) |
| 17074 | VALUES(?,?,?,?,?,?,?) |
| 17075 | """, (owner, aesgcm_encrypt_text(first), aesgcm_encrypt_text(last), aesgcm_encrypt_text(info), profiler_encrypt_optional(opt), now_z(), now_z())) |
| 17076 | eid = cur.lastrowid |
| 17077 | conn.commit() |
| 17078 | conn.close() |
| 17079 | |
| 17080 | for f in files or []: |
| 17081 | if f and f.filename: |
| 17082 | try: |
| 17083 | profiler_store_attachment(eid, f) |
| 17084 | except Exception as e: |
| 17085 | log.exception("Profiler attachment failed: %s", e) |
| 17086 | |
| 17087 | flash("Profiler entry saved.") |
| 17088 | return redirect(url_for("profiler")) |
| 17089 | |
| 17090 | @app.route("/profiler/<int:eid>") |
| 17091 | @login_required |
| 17092 | def profiler_view(eid: int): |
| 17093 | """profiler_view. |
| 17094 | |
| 17095 | Route handler or application helper. |
| 17096 | |
| 17097 | This docstring was expanded to make future maintenance easier. |
| 17098 | |
| 17099 | Args: |
| 17100 | eid: Parameter. |
| 17101 | |
| 17102 | Returns: |
| 17103 | Varies. |
| 17104 | """ |
| 17105 | owner = current_user() |
| 17106 | try: |
| 17107 | entry, atts = profiler_get(owner, eid) |
| 17108 | except KeyError: |
| 17109 | abort(404) |
| 17110 | if entry.get("bounty_price") is not None and not entry.get("bounty_price_display"): |
| 17111 | entry["bounty_price_display"] = _fmt_bounty_price(entry.get("bounty_price")) |
| 17112 | if entry.get("bounty_price") is not None and not entry.get("bounty_price_display"): |
| 17113 | entry["bounty_price_display"] = _fmt_bounty_price(entry.get("bounty_price")) |
| 17114 | class Obj: |
| 17115 | def __init__(self, d): |
| 17116 | """__init__. |
no test coverage detected