drop the door pad off and find the clip that pushes onto the lock to secure it in place, probly inside the door at the bottom if the locks hanging out.
if the clip wont go behind the lock as the actual hole is bent, your gonna need to straighten it so its flat.
1 way would be to mask out the actual hole with masking tape, 4 or 5 times, hold a thick flat piece of metal on the inside of the door (dolly)
and hammer it down from the outside, this should get it flat without damaging the paintwork anymore and enable the clip to slide behind the lock.