<human>: Summarize the given text in a few sentences.

My two year old goes into the bathroom, and turns the lock from the inside, locking himself in. This was a new experience for me, and I hope once in a lifetime.

Our apartment is old - built in the 1920s, with doors to suit. The door has a keyhole, but I realized upon trying to unlock it with the skeleton key, that the key doesn't fit, nor does it do anything. I end up having to bust the door down as images of my toddler drowning in the toilet flash through my head. Turns out he was just throwing rolls of toilet paper into the toilet.

Upon inspecting the locking mechanism, I see no possible way to unlock it from the exterior. It's literally a 4" x 4" metal box with a doorknob sticking through (which is removable). On the interior side, there is a turning lock. 

I had my landlord on the phone while I broke down the door and apologized profusely and offered to pay for it. I also obviously should not have let my two year old into the bathroom unattended. My question is - is this even legal? It seems quite dangerous for exactly the circumstance that just happened.

I'm guessing this is part of current building code given newer doors always have a way to unlock from the exterior.
<bot>: busted down door to save drowning toddler, turns out to just be throwing TP into the potty for shits and giggles.