From 84dfc877e3832cec876c505d8621f48cf8c54e4b Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Tue, 20 Jun 2017 16:31:07 +0200 Subject: [PATCH] error catching around interval parser --- rowers/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rowers/views.py b/rowers/views.py index a47800b1..68781044 100644 --- a/rowers/views.py +++ b/rowers/views.py @@ -7383,7 +7383,10 @@ def workout_summary_edit_view(request,id,message="",successmessage="" if form.is_valid(): cd = form.cleaned_data s = cd["intervalstring"] - rowdata.updateinterval_string(s) + try: + rowdata.updateinterval_string(s) + except IndexError: + messages.error(request,'Interval string parse error') intervalstats = rowdata.allstats() itime,idist,itype = rowdata.intervalstats_values() nrintervals = len(idist)