I just went through my info sources about the matter and all I can find are references to the Gyro angle setting inside the torpedo tubes (Which was continuously updated through contact fuses until the last minute) but no reference to the magnetic/impact exploder. I would say that, due to the characteristics of the pistol, it would need to be adjusted out of the tube

Anyway, US magnetic exploder torpedoes (Can't speak for germans, though) had also a back-up impact detonator, so that in case of bad depth-keeping or failiure of the primary magnetic exploder the torpedo would also explode at least of contact with the hull was made. In those US torpedoes the magnetic detonator was deactivated outside the torpedo tubes AFAIK

so I would guess germans did the same. A real life success: In the USS Jack (Gato class) the commander Thomas Dykers decided to shoot at shallower depths than official doctrine indicated for magnetic torpedoes in order to insure impact detonations. That he did when the confidence in the magnetics was widespreadedly lost among commanding officers, but no deactivation of magnetics was done inside the tube.
P.S. note that torpedoes were frequently pulled out of the tube for routine servicing, so probably it was then when those decissions were made.
Hope that helps