Skip to content

Token "restock" not valid in system-wide notification settings after updating #2880

@rcostanza

Description

@rcostanza

Describe the bug
After updating from a couple months old version (sorry, can't remember which), trying to save system-wide notification settings while either notification title or body uses the token restock prevents from saving settings while also showing the error message below:

The following tokens used in the notification are not valid: restock

If using a restock property directly without checking if restock exists, for example a message composed of just {{ restock.price }}, the error is:

A variable or function is not defined: 'restock' is undefined

When editing settings for a specific watch of type "Re-stock & Price detection", the token is accepted.

Version
v0.48.05

How did you install?
Docker

To Reproduce

  1. Go to settings > notifications
  2. Write the example value below In the notification body field:
    • {% if restock %}From $ {{restock.original_price}} to $ {{restock.price}}{% else %}{{diff}}{% endif %}
  3. Save
  4. An error occurs and the settings aren't saved

Expected behavior
Token should be accepted and settings should be saved, as it worked a few versions ago.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions