Skip to content

Hotfix: Don't assume subscription has a note when showing admin/invoices/failed/ #1425

Description

@chrisjsimpson

Is your feature request related to a problem? Please describe.

UndefinedError
jinja2.exceptions.UndefinedError: 'None' has no attribute 'strip'

https://github.com/Subscribie/subscribie/blob/51fd8052aa08d7fd3dff157fcb9cfafe0f61ed6d/subscribie/blueprints/admin/templates/admin/invoice/failed_invoices.html

                            {% for invoice in debtor['failedInvoices'] %}
                            <tr>
                              <td>{{ invoice.subscribie_subscription.plan.title }}
                              </td>
                              <td>{% if invoice.subscribie_subscription.note %}
                                    {% if invoice.subscribie_subscription.note.note.strip() != '' %}
                                      {{ invoice.subscribie_subscription.note.note }}
                                    {% else %}
                                        <small style="color: lightgrey">None</small>
                                    {% endif %}
                                  {% endif %}

Describe the solution you'd like

Describe alternatives you've considered
actually use a type strict templating language.

Additional context

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions