disable replay from ui for live flows

This commit is contained in:
Maximilian Hils 2015-02-07 19:33:36 +01:00
parent 9a32193005
commit 5d56870818
2 changed files with 5 additions and 0 deletions

View File

@ -828,6 +828,8 @@ class FlowMaster(controller.Master):
""" """
Returns None if successful, or error message if not. Returns None if successful, or error message if not.
""" """
if f.live and run_scripthooks:
return "Can't replay live request."
if f.intercepted: if f.intercepted:
return "Can't replay while intercepting..." return "Can't replay while intercepting..."
if f.request.content == http.CONTENT_MISSING: if f.request.content == http.CONTENT_MISSING:

View File

@ -666,6 +666,9 @@ class TestFlowMaster:
f.intercepted = True f.intercepted = True
assert "intercepting" in fm.replay_request(f) assert "intercepting" in fm.replay_request(f)
f.live = True
assert "live" in fm.replay_request(f, run_scripthooks=True)
def test_script_reqerr(self): def test_script_reqerr(self):
s = flow.State() s = flow.State()
fm = flow.FlowMaster(None, s) fm = flow.FlowMaster(None, s)