Air India has had its problems such as flight attendants controlling planes, and now add to that a pilot getting locked out of the cockpit.

Perth Now reports an Air India flight from Delhi to Bangalore had to be diverted because the pilot got locked out of the cockpit after a trip to the bathroom.

With the door jammed, a trainee pilot was left to safely land the plane in Bhopal, in central India.

According to the paper, maintenance crews on the ground were able to get the door fixed.