def create_story_note(request): """ Post a note to an story.""" if request.method == "POST": form = StoryNoteForm(request.POST or None) if form.is_valid(): story_id = request.POST.get('story') story = get_object_or_404(Story, pk=story_id) storynote = form.save(commit=False) storynote.owner = request.user storynote.story = story storynote.save() return redirect('story_detail', pk=story.id)
def create_story_note(request): """ Post a note to an story.""" if request.method == "POST": form = StoryNoteForm(request.POST or None) if form.is_valid(): story_id = request.POST.get('story') story = get_object_or_404(Story, pk=story_id) storynote = form.save(commit=False) storynote.owner = request.user storynote.organization = request.user.organization storynote.story = story storynote.save() # record action for activity story_team action.send(request.user, verb="added note", action_object=storynote, target=story) return redirect('story_detail', pk=story.id)