Skip to content

Commit c5e46cd

Browse files
committed
добавил возможность пустого сообщения
1 parent f4fdb3d commit c5e46cd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

worker/consumer.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@
2222

2323
def process_models(key: Any, value: Any) -> tuple[UserLoginKey | None, UserLogin | None]:
2424
try:
25-
return UserLoginKey.model_validate(key), UserLogin.model_validate(value)
25+
processed_k = UserLoginKey.model_validate(key)
26+
processed_v = None
27+
if value is not None:
28+
processed_v=UserLogin.model_validate(value)
29+
return processed_k, processed_v
2630
except pydantic.ValidationError:
2731
log.error(f"Validation error occurred, {key=}, {value=}", exc_info=False)
2832
return None, None

0 commit comments

Comments
 (0)