From 007fd2ec8fc5273156db15fc101f608bdb63f8fa Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Tue, 27 Jan 2026 12:16:56 -0500 Subject: [PATCH] Refactor Post and Post Comment models to strictly use Vision ID string pattern Updated Post_Base and Post_Comment_Base to ensure integer IDs (post_id, post_comment_id) are explicitly removed during validation to prevent mixed-type ID collisions. This hardens the V3 Vision standard compliance. --- app/models/post_comment_models.py | 2 +- app/models/post_models.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/post_comment_models.py b/app/models/post_comment_models.py index 34e5015..fef90df 100644 --- a/app/models/post_comment_models.py +++ b/app/models/post_comment_models.py @@ -74,7 +74,7 @@ class Post_Comment_Base(BaseModel): values['user_id'] = u_rid # 2. Prevent "Collision Population" - for k in ['id', 'post_id', 'person_id', 'user_id']: + for k in ['id', 'post_comment_id', 'post_id', 'person_id', 'user_id']: if k in values and not isinstance(values[k], str): del values[k] diff --git a/app/models/post_models.py b/app/models/post_models.py index a90fd4e..b9edeba 100644 --- a/app/models/post_models.py +++ b/app/models/post_models.py @@ -108,7 +108,7 @@ class Post_Base(BaseModel): values['user_id'] = u_rid # 2. Prevent "Collision Population" - for k in ['id', 'account_id', 'person_id', 'user_id']: + for k in ['id', 'post_id', 'account_id', 'person_id', 'user_id']: if k in values and not isinstance(values[k], str): del values[k]