Self Discipline
Like it or not, we're not all Pablo Picasos or Walt Whitmans who can code only if and when the muse strikes us.
Most programmers have likely already discovered they're asked to code things they're not personally enthused about all the time. You also need to find a way to reach inside yourself and pull out good code even when the mood is wrong.