I'm sorry to hear about your loss.
As regards your diet, I think the thing you need to remember is that your "diet" is really a forever change in your lifestyle. Life is always going to throw unexpected events in your path, and you need to find a way to roll with them. Even during the weight loss phase of your diet, you aren't always going to be able to stick 100% to plan.
What you need to do is try to make the wisest food choices you can given the circumstances. When it's over, you simply go back to plan, without blame or guilt, and keep going.
Real life is going to throw celebrations and sad times in your path, and part of the lesson that you'll need to learn is how to get through those times, eating a little more if you have to, and then go right back to plan so that you don't gain all your weight back.
Hang in there. My heart goes out to you.