def group_detail(request, slug, template_name='groups/group_detail.html'):
 group = get_object_or_404(Group, slug=slug, is_active=True)
 if (group.invite_only and (not GroupMember.objects.is_member(group, request.user))):
  return redirect(request, reverse('groups:join', kwargs={'slug': group.slug}))
 return render(request, template_name, {'group': group, 'topic_list': group.topics.all()})

def group_detail ( request , slug , template_name = 'groups/group_detail.html' ) : group = get_object_or_404 ( Group , slug = slug , is_active = True ) if ( group . invite_only and ( not GroupMember . objects . is_member ( group , request . user ) ) ) : return redirect ( request , reverse ( 'groups:join' , kwargs = { 'slug' : group . slug } ) ) return render ( request , template_name , { 'group' : group , 'topic_list' : group . topics . all ( ) } )
returns a group detail page .