@membership_required
def topic_remove(request, slug, topic_id, template_name='groups/topics/topic_remove_confirm.html'):
 group = get_object_or_404(Group, slug=slug)
 topic = get_object_or_404(GroupTopic, pk=topic_id, group=group, user=request.user)
 if (request.method == 'POST'):
  topic.is_active = False
  topic.save()
  return redirect(request, group)
 return render(request, template_name, {'topic': topic})

@ membership_required def topic_remove ( request , slug , topic_id , template_name = 'groups/topics/topic_remove_confirm.html' ) : group = get_object_or_404 ( Group , slug = slug ) topic = get_object_or_404 ( GroupTopic , pk = topic_id , group = group , user = request . user ) if ( request . method == 'POST' ) : topic . is_active = False topic . save ( ) return redirect ( request , group ) return render ( request , template_name , { 'topic' : topic } )
returns a group topic delete confirmation page .