Understanding the steps in Callbacks

Hi everyone,
in lesson 9’s callbacks section, we define a fit function, with a single step defined by one_batch():

def one_batch(xb, yb, cb):
if not cb.begin_batch(xb,yb): return
loss = cb.learn.loss_func(cb.learn.model(xb), yb)
if not cb.after_loss(loss): return
if cb.after_backward(): cb.learn.opt.step()
if cb.after_step(): cb.learn.opt.zero_grad()

this function is called for training mode, as well as Validation mode.
I went through the callbacks, and there is no sort of code that says that opt.step() should not be called during validation. Can someone help me in this? Whats stopping this function from not updating parameters during validdation? Thanks