Skip to content
This repository was archived by the owner on Jun 29, 2020. It is now read-only.

Fix bug that leads to no output when PUPPETEER_PDF_CMD_OPTIONS is configured #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cassidylaidlaw
Copy link

If PUPPETEER_PDF_CMD_OPTIONS is configured in the Django settings without a 'path' key, then no --path argument is passed to puppeteer-pdf. In that case, an empty response is returned. It seems like one should be able to configured options without specifying a specific path to use every time, so I fixed it to always include a path key. Let me know if that seems reasonable.

@gevezex
Copy link

gevezex commented Jun 20, 2020

What happened to this fix? As the bug is still there.

@gevezex
Copy link

gevezex commented Jun 22, 2020

For what is worth, this can be solved by adding the line to the utils.py line 76:

    # Default options:
    options = getattr(settings, 'PUPPETEER_PDF_CMD_OPTIONS', None)
    if options is None:
        options = {'path': output}
    else:
        options = copy(options)
        options['path'] = output   # add this line
    options.update(kwargs)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants