Exemple #1
0
def serve_press_cover(request):
    """
    Returns the Press's cover file
    :param request: HttpRequest object
    :return: HttpStreamingResponse object with file
    """
    p = press_models.Press.get_press(request)

    response = files.serve_press_cover(request, p.thumbnail_image)

    return response
Exemple #2
0
def serve_journal_cover(request):
    """ Serves the cover image for this journal or, if not affiliated with a journal, serves the press logo.

    :param request: the request associated with this call
    :return: a streaming response of the retrieved image file
    """
    if not request.journal:
        # URL accessed from press site so serve press cover
        response = files.serve_press_cover(request, request.press.thumbnail_image)

        return response

    if not request.journal.thumbnail_image:
        logic.install_cover(request.journal, request)

    response = files.serve_journal_cover(request, request.journal.thumbnail_image)

    return response
Exemple #3
0
def serve_press_cover(request):
    p = press_models.Press.get_press(request)

    response = files.serve_press_cover(request, p)

    return response