profiler_view_only. Route handler or application helper. This docstring was expanded to make future maintenance easier. Args: eid: Parameter. Returns: Varies.
(eid: int)
| 16253 | Varies. |
| 16254 | """ |
| 16255 | conn = db_connect() |
| 16256 | r = conn.execute(""" |
| 16257 | SELECT * FROM profiler_entries WHERE id=? AND owner=? |
| 16258 | """, (eid, owner)).fetchone() |
| 16259 | if not r: |
| 16260 | conn.close() |
| 16261 | raise KeyError("not found") |
| 16262 | att = conn.execute(""" |
| 16263 | SELECT id, entry_id, filename_enc, mime_enc, stored_path, created_at |
| 16264 | FROM profiler_attachments WHERE entry_id=? ORDER BY id DESC |
| 16265 | """, (eid,)).fetchall() |
| 16266 | conn.close() |
| 16267 | |
| 16268 | def dtxt(x, fallback): |
| 16269 | """dtxt. |
| 16270 | |
| 16271 | Route handler or application helper. |
| 16272 | |
| 16273 | This docstring was expanded to make future maintenance easier. |
| 16274 | |
| 16275 | Args: |
| 16276 | x: Parameter. |
| 16277 | fallback: Parameter. |
| 16278 | |
| 16279 | Returns: |
| 16280 | Varies. |
| 16281 | """ |
| 16282 | try: return aesgcm_decrypt_text(x) |
| 16283 | except Exception: return fallback |
| 16284 | |
| 16285 | entry = { |
| 16286 | "id": r["id"], |
| 16287 | "owner": r["owner"], |
| 16288 | "first": dtxt(r["first_enc"], "[decrypt failed]"), |
| 16289 | "last": dtxt(r["last_enc"], "[decrypt failed]"), |
| 16290 | "info": dtxt(r["info_enc"], "[decrypt failed]"), |
| 16291 | "opt": profiler_decrypt_optional(r["optional_enc"] if "optional_enc" in r.keys() else None), |
| 16292 | "bounty_price": (float(r["bounty_price"]) if ("bounty_price" in r.keys() and r["bounty_price"] is not None) else None), |
| 16293 | "bounty_set_by": (r["bounty_set_by"] if "bounty_set_by" in r.keys() else None), |
| 16294 | "bounty_updated_at": (r["bounty_updated_at"] if "bounty_updated_at" in r.keys() else None), |
| 16295 | "bounty_reason": (r["bounty_reason"] if "bounty_reason" in r.keys() else None), |
| 16296 | "bounty_price_display": (_fmt_bounty_price(r["bounty_price"]) if ("bounty_price" in r.keys() and r["bounty_price"] is not None) else None), |
| 16297 | "created_at": r["created_at"], |
nothing calls this directly
no test coverage detected