@permission_required([('AccountLookup', 'View')])
def user_activity(request, user_id):
 user = get_object_or_404(UserProfile, pk=user_id)
 products = purchase_list(request, user)
 is_admin = acl.action_allowed(request, 'Users', 'Edit')
 user_items = ActivityLog.objects.for_user(user).exclude(action__in=mkt.LOG_HIDE_DEVELOPER)
 admin_items = ActivityLog.objects.for_user(user).filter(action__in=mkt.LOG_HIDE_DEVELOPER)
 mkt.log(mkt.LOG.ADMIN_VIEWED_LOG, request.user, user=user)
 return render(request, 'lookup/user_activity.html', {'pager': products, 'account': user, 'is_admin': is_admin, 'single': bool(None), 'user_items': user_items, 'admin_items': admin_items, 'show_link': False})

@ permission_required ( [ ( 'AccountLookup' , 'View' ) ] ) def user_activity ( request , user_id ) : user = get_object_or_404 ( UserProfile , pk = user_id ) products = purchase_list ( request , user ) is_admin = acl . action_allowed ( request , 'Users' , 'Edit' ) user_items = ActivityLog . objects . for_user ( user ) . exclude ( action__in = mkt . LOG_HIDE_DEVELOPER ) admin_items = ActivityLog . objects . for_user ( user ) . filter ( action__in = mkt . LOG_HIDE_DEVELOPER ) mkt . log ( mkt . LOG . ADMIN_VIEWED_LOG , request . user , user = user ) return render ( request , 'lookup/user_activity.html' , { 'pager' : products , 'account' : user , 'is_admin' : is_admin , 'single' : bool ( None ) , 'user_items' : user_items , 'admin_items' : admin_items , 'show_link' : False } )
shows the user activity page for another user .