Feat: [#58] 유저 필드에 값이 있는지 체크하는 함수 구현

This commit is contained in:
sm4640
2025-05-20 00:08:29 +09:00
parent b6a45434ca
commit a64c9fcd01

View File

@@ -24,6 +24,15 @@ class CheckUserFieldDuplicateService:
return User.objects.filter(**filter_dict).exists()
class CheckUserFieldValueExistService:
@staticmethod
def check_exist(user: User, field) -> bool:
if not field:
return False
if getattr(user, field) == None:
return False
else:
return True
class UserToNotificationService:
@staticmethod