From ed66ba4bd4aacfd1d5180f3f142893f5424f9866 Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Fri, 1 May 2026 18:20:10 -0400 Subject: [PATCH] fix(post): retain topic_id and note review --- app/models/post_models.py | 8 ++++---- documentation/TODO__Agents.md | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/models/post_models.py b/app/models/post_models.py index 389ccb9..ed50aad 100644 --- a/app/models/post_models.py +++ b/app/models/post_models.py @@ -32,7 +32,7 @@ class Post_Base(BaseModel): # type_id: Optional[int] # topic_id_random: Optional[str] - # topic_id: Optional[int] + topic_id: Optional[int] type: Optional[str] @@ -101,18 +101,18 @@ class Post_Base(BaseModel): if rid and isinstance(rid, str): values['id'] = rid values['post_id'] = rid - + if a_rid := values.get('account_id_random'): values['account_id'] = a_rid if p_rid := values.get('person_id_random'): values['person_id'] = p_rid if u_rid := values.get('user_id_random'): values['user_id'] = u_rid - + # 2. Prevent "Collision Population" or leakage of integers during API responses for k in ['id', 'post_id', 'account_id', 'person_id', 'user_id']: val = values.get(k) if val is not None and not isinstance(val, str): if values.get(f'{k}_random') or (k=='id' and values.get('id_random')): del values[k] - + return values class Config: diff --git a/documentation/TODO__Agents.md b/documentation/TODO__Agents.md index efc9ad8..b75be2e 100644 --- a/documentation/TODO__Agents.md +++ b/documentation/TODO__Agents.md @@ -61,6 +61,7 @@ - **Webhook approach abandoned** — cron is simpler; Novi webhook payload format is unknown and Novi hasn't been configured to send webhooks. - **Remaining:** Set production group→list mappings in `cfg_json`, configure cron schedule, rotate Mailman `restadmin` password. - [ ] **Lookup System Batch 2:** Migration of `post_topic`, `user_status`, `file_purpose`. +- [ ] **Post Topic Storage Review:** Revisit whether IDAA BB posts should keep the lookup-based `topic_id`/`topic_name` shape or eventually flatten to saved topic text if the list stays fixed. - [ ] **Zoom Events Integration:** Implement cron synchronization for OAuth2 ticket retrieval. ## 📝 Session Notes (March 11, 2026)