Minor badge clean up
This commit is contained in:
@@ -175,6 +175,13 @@ class Event_Badge_Base(BaseModel):
|
||||
return redis_lookup_id_random(record_id_random=id_random, table_name='event')
|
||||
return None
|
||||
|
||||
@validator('event_id_only', always=True)
|
||||
def event_id_only_lookup(cls, v, values, **kwargs):
|
||||
if isinstance(v, int) and v > 0: return v
|
||||
elif id_random := values.get('event_id_random_only'):
|
||||
return redis_lookup_id_random(record_id_random=id_random, table_name='event')
|
||||
return None
|
||||
|
||||
@validator('event_badge_template_id', always=True)
|
||||
def event_badge_template_id_lookup(cls, v, values, **kwargs):
|
||||
if isinstance(v, int) and v > 0: return v
|
||||
|
||||
Reference in New Issue
Block a user