Thread:Extension talk:Scribunto/How to detect EDIT state ?

In this Module, I display some errors (red colored) to guide the user to use the template. I can display them in some namespaces and not in others. But this is not OK because some errors must disappear when the user validate the page. How to detect EDIT state from Lua level ?