From 28fe278bc6fb9bea157afe3dddf0f70f10211070 Mon Sep 17 00:00:00 2001 From: KnucklesSG1 Date: Tue, 30 Jul 2024 14:46:38 -0500 Subject: [PATCH] Filter out None values. --- gitlab_api/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gitlab_api/utils.py b/gitlab_api/utils.py index 1d3f2d3..c6aeca3 100644 --- a/gitlab_api/utils.py +++ b/gitlab_api/utils.py @@ -80,5 +80,6 @@ def pydantic_to_sqlalchemy(pydantic_model): related_instance = pydantic_to_sqlalchemy(nested_model) setattr(sqlalchemy_instance, key, related_instance) else: - setattr(sqlalchemy_instance, key, value) + if value: + setattr(sqlalchemy_instance, key, value) return sqlalchemy_instance