Well there are a lot of possibilities here.
1) if the players group is called "Player" with a capital p and you have written "player" in the code above then it wont see the if block code.
2) If you have your player and other nodes on different levels then it may be that the collision node is not set up to detect any objects on the layer your player is on and thus this function is never activated
3) you may not have actually connected the signal of body entered to the function above
4) you may not have added a collision layer to your player.
Based on just the above it is impossible for me to say, there may even be another option but in principle at least your code above looks fine.