Clean up and debugging.

This commit is contained in:
Scott Idem
2023-01-30 17:59:13 -05:00
parent b510a44adf
commit a9f0e2bf3d
3 changed files with 13 additions and 29 deletions

View File

@@ -179,11 +179,9 @@ class Event_Base(BaseModel):
@validator('account_id', always=True)
def account_id_lookup(cls, v, values, **kwargs):
log.setLevel(logging.WARNING)
log.debug(locals())
if values['account_id_random']:
return redis_lookup_id_random(record_id_random=values['account_id_random'], table_name='account')
if isinstance(v, int) and v > 0: return v
elif id_random := values.get('account_id_random'):
return redis_lookup_id_random(record_id_random=id_random, table_name='account')
return None
@validator('poc_event_person_id', always=True)