-
-
Notifications
You must be signed in to change notification settings - Fork 696
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
Assertion Error in 54.0 #1538
Comments
Hello! |
Sure, but it happens on all Controller: def pdf(self, id):
from flask_weasyprint import render_pdf, HTML
return render_pdf(HTML(string=self.template(template_name="show", print=True))) Template: {% extends "base/base.html.j2" %}
{% block title %} {{ recipe.name }} {% endblock %}
{% block content %}
<div id="recipe-info">
<h2> {{ recipe.name }} </h2>
</div>
<div class="row">
<div class="col-md-10 col-sm-12">
<table id="ingredients" class="table">
<thead>
<tr>
<th>{{ texts.title }}</th>
<th>Množství (na {{recipe.portion_count}} porcí)</th>
<th></th>
</tr>
</thead>
{% for ingredient in recipe.ingredients: %}
{% set ingredient_amount = ingredient.amount * recipe.portion_count %}
<tr>
{% if not print and current_user.is_authenticated %}
<td> {{ link_to(ingredient) }}
{% if ingredient.is_public %} {{ icon("public", class="text-secondary") }} {% endif %}
</td>
{% else %}
<td> {{ ingredient.name }} </td>
{% endif %}
<td>
{% if ingredient.is_measured %}
{% if ingredient.measurement.thousand_fold and ingredient_amount % 1000 != ingredient_amount %}
{{ formatted_amount(ingredient_amount/1000) }} {{ ingredient.measurement.thousand_fold }}
{% else %}
{{ formatted_amount(ingredient_amount) }} {{ ingredient.measurement.name }}
{% endif %}
{% if ingredient.alternative_measurement %}
{% set ns = namespace(title="přibližně\n") %}
{% for conversion in ingredient.alternative_measurements %}
{% set ns.title = ns.title + formatted_amount(ingredient_amount/conversion.amount_from * conversion.amount_to) | string + " " + conversion.to_measurement.name %}
{% set ns.title = ns.title + "\n" %}
{% endfor %}
<abbr title="{{ ns.title }}">
{{ icon("info-circle", class="ms-1") }}
</abbr>
{% endif %}
{% endif %}
</td>
<td><em>{{ ingredient.comment|default("", True) }}</em></td>
</tr>
{% endfor %}
</table>
</div>
</div>
{% endblock %} using Bootstrap for design |
Thanks for this bug report! It’s now fix in the 54.x branch. This crash was caused by a variable that isn’t set in Bootstrap for text-align, which lead to a None value. |
Same Issue, solved by downgrading to |
I started getting AssertionError:
Code was working in 53.4, not working now in 54.0
Downgrading to 53.4 solves the problem.
The text was updated successfully, but these errors were encountered: