#NEWLINE# @ login_required #NEWLINE# def _activity( request , pk , slug , queryset , template , reverse_to , context_name , per_page ) : #NEWLINE# #INDENT# p_user = get_object_or_404 ( User , pk = pk ) #NEWLINE# if ( p_user . st . slug != slug ) : #NEWLINE# #INDENT# url = reverse ( reverse_to , kwargs = { #NEWLINE# #INDENT# 'pk' : p_user . pk , #NEWLINE# 'slug' : p_user . st . slug , #NEWLINE# #UNINDENT# } ) #NEWLINE# return HttpResponsePermanentRedirect ( url ) #NEWLINE# #UNINDENT# items = yt_paginate ( queryset , per_page = per_page , page_number = request . GET . get ( 'page' , 1 ) ) #NEWLINE# context = { #NEWLINE# #INDENT# 'p_user' : p_user , #NEWLINE# context_name : items , #NEWLINE# #UNINDENT# } #NEWLINE# return render ( request , template , context )