Spaces gone
This commit is contained in:
@@ -98,18 +98,18 @@ class Event_Badge_Template_Base(BaseModel):
|
|||||||
if rid := values.get('id_random') or values.get('event_badge_template_id_random'):
|
if rid := values.get('id_random') or values.get('event_badge_template_id_random'):
|
||||||
values['id'] = rid
|
values['id'] = rid
|
||||||
values['event_badge_template_id'] = rid
|
values['event_badge_template_id'] = rid
|
||||||
|
|
||||||
if e_rid := values.get('event_id_random'):
|
if e_rid := values.get('event_id_random'):
|
||||||
values['event_id'] = e_rid
|
values['event_id'] = e_rid
|
||||||
|
|
||||||
if a_rid := values.get('account_id_random'):
|
if a_rid := values.get('account_id_random'):
|
||||||
values['account_id'] = a_rid
|
values['account_id'] = a_rid
|
||||||
|
|
||||||
# 2. Prevent "Collision Population" (ensure no integers leak into the clean string fields)
|
# 2. Prevent "Collision Population" (ensure no integers leak into the clean string fields)
|
||||||
for k in ['id', 'event_badge_template_id', 'event_id', 'account_id']:
|
for k in ['id', 'event_badge_template_id', 'event_id', 'account_id']:
|
||||||
if k in values and not isinstance(values[k], str) and values[k] is not None:
|
if k in values and not isinstance(values[k], str) and values[k] is not None:
|
||||||
del values[k]
|
del values[k]
|
||||||
|
|
||||||
return values
|
return values
|
||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
|
|||||||
Reference in New Issue
Block a user