Counsel Meg Scally told the court that on the day in question Codlin had noticed her mental health was deteriorating and organised for her children to stay with their father.
"She was grieving over that decision and decided to turn to alcohol," Scally said.
The defendant ended up in a central Dunedin bar at midnight when she began approaching other customers, asking if they were "Kiwis".
She followed that up with a hostile barrage.
"F... Muslims. They come into our country and steal our jobs and kill our people."
It was not long before the duty manager asked Codlin to leave, following numerous complaints by patrons.
She did so, but took a glass with her.
When the manager followed to try to get it back, Codlin aimed a kick for his groin but ended up striking him in the knee.
The victim restrained the woman and, after momentarily calming down, she spat in his face.
Even after police arrived, Codlin continued to yell abuse and scream disparaging remarks about Muslims.
Judge Walker noted she had previous convictions for dishonesty and disorderly conduct.
"It appears you think you can do and say whatever you think without consequences," he said.
"You say you don't consider yourself a racist. Be in no doubt what you said was racist, offensive and clearly abhorrent. It's clear you hold some distorted views, exacerbated by alcohol abuse."
Scally said Codlin was under the erroneous assumption that the impending Anzac Day commemorations would somehow be affected by the terror attacks in Christchurch the previous month.
The defendant's grandfather fought in the war and she was "very proud" of that.
Judge Walker picked up that thread.
"You do your family heritage no credit making comments of this nature," he said.
Codlin will serve her sentence in Waimate.
The judge declined an application to photograph her because of her mental health problems.