def photo_list(request, course_slug, style='horiz'):
    if style not in PHOTO_LIST_STYLES:
        raise Http404
    user = get_object_or_404(Person, userid=request.user.username)
    if not has_photo_agreement(user):
        url = reverse('config:photo_agreement') + '?return=' + urllib.parse.quote(request.path)
        return ForbiddenResponse(request, mark_safe('You must <a href="%s">confirm the photo usage agreement</a> before seeing student photos.' % (url)))