refactor(manage_notification): solved the issue of cron for push notification and filter in report

This commit is contained in:
bobbyvish
2024-05-09 16:21:48 +05:30
parent b93c207ee6
commit 2fe49465b5
10 changed files with 133 additions and 55 deletions

View File

@@ -256,13 +256,16 @@ class GoogleSignin(APIView):
player_id = request.data["player_id"]
user_info = GoogleAuthService.get_user_info(access_token)
print(f"User Info : {user_info}")
print(f"User Info : {user_info} and player id is {player_id}")
# Authenticate user with the email provided by Google
user = IAmPrincipal.objects.filter(email=user_info['email']).first(
) or authenticate(email=user_info['email'], password=None)
if user is None:
if user:
# Update the player_id for the existing user
IAmPrincipal.objects.filter(email=user_info['email']).update(player_id=player_id)
else:
# Create a new user if not found
user = IAmPrincipal.objects.create_user(
username=user_info['email'],