Skip to content

Commit

Permalink
add_timeline without m2m
Browse files Browse the repository at this point in the history
  • Loading branch information
Johan Berggren committed Nov 10, 2014
1 parent 338184b commit bf77acc
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions timesketch/apps/ui/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,10 @@ def add_timeline(request, sketch_id):
if form_timelines:
for timeline_id in form_timelines:
t = Timeline.objects.get(id=timeline_id)
sketch_timeline = SketchTimeline.objects.create(timeline=t)
sketch_timeline = SketchTimeline.objects.create(
timeline=t, sketch=sketch, user=request.user)
sketch_timeline.color = sketch_timeline.generate_color()
sketch_timeline.save()
sketch.timelines.add(sketch_timeline)
sketch.save()
return redirect("/sketch/%s/timelines/" % sketch.id)
timelines = set()
for timeline in Timeline.objects.all():
Expand Down

0 comments on commit bf77acc

Please sign in to comment.