Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checking if a chart is closed before rendering html/json #163

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

Conversation

myrmarachne
Copy link
Member

No description provided.

Comment on lines +111 to +119
def generate_html(self, document: Optional[Document] = None) -> str:
"""
Generates the HTML necessary to display the underlying chart in a PDF document. The chart is rendered in
memory, then encoded to base64 and embedded in the HTML
"""
if self._chart.closed:
self.logger.warning('Chart generation error: The chart you are trying to generate has been already closed. '
'Check if you are not trying to regenerate the html for an already processed chart.')
result = "<h2 class='chart-render-failure'>Failed to render chart</h1>"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function has the wrong indentation level so it's not a part of the class, and all of the code below it as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants