Personally I think that so long as you don't have an affair with the 'trainee', then it's ok to have your life made happier and to remember who you are ... for a bit. It will fizzle out, honestly. You can't imagine it ever could, but it will. It might take a few months. Or a year or so. Typically these crushes, if not turned into affairs, go on for a good year or more, and then, once both sides realise that nothing is actually going further, fall into a kind of affectionate occasional mild flirting. A kind of 'it might have been sort of in a parallel universe'. Basically, without even saying it, your mutual attraction and admiration is understood, and it makes you both feel better.
Of course you need to try to sort it with the DH. You sound in a total rut with him. These things also change - even if you mostly don't like him now, it might improve. The usual process is to try to like him again, and if that really doesn't work, either to decide to stay with him and be miserable, or stay with him and have someone on the side, or leave him. (I'm stating facts here - not endorsing any courses of action!!)
I myself would find out as soon as possible if it's salvageable with DH, and if not I'd leave him. Then something might happen with trainee, might not. Fancying the trainee could either mean he's better for you than DH, or just that you're unhappy with DH and trainee is something new and different.
Either way, you will have to address the real situation with DH.
And having said I don't advocate any particular course of action, I would actually say that whatever you do, you really should not have a physical affair with someone else while with DH. If you don't want DH, leave him. If you do want him, don't fuck someone else.
A bit of work to do on your part - try to sort out what you want, and what is fair.
But if you want DH, and Trainee just makes you feel happier over the photocopier for a while - I think that's ok. It helps remind you of who you are, independent of any relationship.