Gastric Bypass Surgery Support Group
Gastric bypass (GBP) is any of a group of similar operative procedures used to treat morbid obesity, a condition which arises from severe accumulation of excess weight in the form of fatty tissue, and the health problems ("co-morbidities") which result. If you are considering gastric bypass or have had it, join the community where we share our experiences and find support.

I would absolutely not consider it without my doctor's approval.
My other thought, as noted in the other reply, controlling the "munchies" could really sabotage the surgery and hard work associated with it.
Talk to your doc honestly... And follow his advice...
The other thing I found out is that a real low doses, the pain is reduced. Trying a higher dose, I felt no pain, but I was also too stoned to function at all. Maybe I could get the correct dose, but I think that may be hard to judge.
third, I think the cost would also make me think twice. I can get Pain meds for a $10 co-pay for a month. It may be OK to take a break maybe in the future.
I did try to use low THC,and high CBD, so as not to get too stoned nor get the munchies. I didn;t really get the munchies from what I used. I think the weed nowdays is more potent than ever, now that one can get medical grade weed.