refactor(manage_notification): solved the issue of cron for push notification and filter in report
This commit is contained in:
@@ -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'],
|
||||
|
||||
Reference in New Issue
Block a user