What is the meaning of [the danger past and God forgotten]

People are prone to calling on God in times of trouble, only to forget all about their newly found religious faith as soon as the crisis is past.