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.
This commit is contained in:
@@ -74,7 +74,7 @@ class Post_Comment_Base(BaseModel):
|
|||||||
values['user_id'] = u_rid
|
values['user_id'] = u_rid
|
||||||
|
|
||||||
# 2. Prevent "Collision Population"
|
# 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):
|
if k in values and not isinstance(values[k], str):
|
||||||
del values[k]
|
del values[k]
|
||||||
|
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ class Post_Base(BaseModel):
|
|||||||
values['user_id'] = u_rid
|
values['user_id'] = u_rid
|
||||||
|
|
||||||
# 2. Prevent "Collision Population"
|
# 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):
|
if k in values and not isinstance(values[k], str):
|
||||||
del values[k]
|
del values[k]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user