

@login_required
def user_photos(request, username, template_name='photos/user_photos.html'):
    '\n    Get the photos of a user and display them\n    '
    user = get_object_or_404(User, username=username)
    image_filter = Q(is_public=True)
    if request.user.is_authenticated():
        image_filter = ((image_filter | Q(member=request.user)) | Q(member__in=friend_set_for(request.user)))
    photos = Image.objects.filter(image_filter, member=user)
    photos = photos.order_by('-date_added')
    (group, bridge) = group_and_bridge(request)
    ctx = group_context(group, bridge)
    ctx.update({
        'photos': photos,
        'username': user,
    })
    return render_to_response(template_name, RequestContext(request, ctx))

dataset/ETHPy150Open amarandon/smeuhsocial/apps/photos/views.py user_photos/VarMisuse@139/211 `username`->`user`