profiler_create. Route handler or application helper. This docstring was expanded to make future maintenance easier. Returns: Varies.
()
| 16167 | try: |
| 16168 | o = profiler_decrypt_optional(r["optional_enc"] or "") |
| 16169 | if (o.get("autosync_type") == _AUTOSYNC_TYPE) and (o.get("autosync_username") == username): |
| 16170 | target_id = int(r["id"]) |
| 16171 | break |
| 16172 | except Exception: |
| 16173 | continue |
| 16174 | |
| 16175 | first_enc = aesgcm_encrypt_text(first) |
| 16176 | last_enc = aesgcm_encrypt_text(last) |
| 16177 | info_enc = aesgcm_encrypt_text(info) |
| 16178 | opt_enc = profiler_encrypt_optional(opt) |
| 16179 | |
| 16180 | if target_id is None: |
| 16181 | conn.execute( |
| 16182 | "INSERT INTO profiler_entries(owner, first_enc, last_enc, info_enc, optional_enc, created_at, updated_at) VALUES (?,?,?,?,?,?,?)", |
| 16183 | (username, first_enc, last_enc, info_enc, opt_enc, now_z(), now_z()), |
| 16184 | ) |
| 16185 | else: |
| 16186 | conn.execute( |
| 16187 | "UPDATE profiler_entries SET first_enc=?, last_enc=?, info_enc=?, optional_enc=?, updated_at=? WHERE id=? AND owner=?", |
| 16188 | (first_enc, last_enc, info_enc, opt_enc, now_z(), target_id, username), |
| 16189 | ) |
| 16190 | conn.commit() |
| 16191 | conn.close() |
| 16192 | |
| 16193 | |
| 16194 | |
| 16195 | def profiler_list(owner: str) -> List[Dict[str, str]]: |
| 16196 | """profiler_list. |
| 16197 | |
| 16198 | Internal helper function. |
| 16199 | |
| 16200 | This docstring was added automatically to improve maintainability. |
| 16201 | |
| 16202 | Args: |
| 16203 | owner: Parameter. |
| 16204 | |
| 16205 | Returns: |
| 16206 | Varies. |
| 16207 | """ |
| 16208 | conn = db_connect() |
| 16209 | rows = conn.execute(""" |
| 16210 | SELECT id, owner, first_enc, last_enc, info_enc, created_at, updated_at, |
| 16211 | bounty_price, bounty_set_by, bounty_updated_at, bounty_reason |
nothing calls this directly
no test coverage detected