From ec3a9700a5fbc2b83645d7d2881e8f3e57f60bcf Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Sun, 26 Nov 2017 08:32:47 +0100 Subject: [PATCH] inheritance in gluing --- rowers/dataprep.py | 9 +++++++++ rowers/views.py | 10 +++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/rowers/dataprep.py b/rowers/dataprep.py index 3261c14f..5ae7c006 100644 --- a/rowers/dataprep.py +++ b/rowers/dataprep.py @@ -196,6 +196,15 @@ def join_workouts(r,ids,title='Joined Workout', # reorder in chronological order ws = Workout.objects.filter(id__in=ids).order_by("date", "starttime") + + if not parent: + parent = ws[0] + oarlength = parent.oarlength + inboard = parent.inboard + workouttype = parent.workouttype + notes = parent.notes + summary = parent.summary + files = [w.csvfilename for w in ws] row = rdata(files[0]) diff --git a/rowers/views.py b/rowers/views.py index 97315c9a..ae7fd888 100644 --- a/rowers/views.py +++ b/rowers/views.py @@ -4225,11 +4225,11 @@ def workouts_join_view(request): if message: messages.error(request,message) - url = reverse(workout_edit_view, - kwargs = { - 'id':int(id), - }) - + url = reverse(r.defaultlandingpage, + kwargs = { + 'id':int(id), + }) + return HttpResponseRedirect(url) else: