Skip to content

Notification Link being overridden. #12706

Closed

Description

@psxjt5

Please verify that this bug has NOT been raised before.

  • I checked and didn't find a similar issue

Describe the bug*

When triggering a notification with a defined link, such as:

trigger_notification(
    obj=plugin_config,
    category="test.notification",
    targets=user,
    context={
        "name": "Test Notification",
        "message": "Sample Notification.",
        "link": "/web/settings/admin/plugin/inventree_bambu/"
    },
    check_recent=False,
)

the notification is instead linking to web/settings/admin/plugin/44/ (instead of /web/settings/admin/plugin/inventree_bambu/ as defined by the link field).

In NotificationDrawer, there's a specific section which overrides the link if a valid model is specified:

// If a valid model type is provided, that overrides the specified link
  if (model_type as ModelType) {
    const model_info = ModelInformationDict[model_type as ModelType];
    if (model_info?.url_detail && model_id) {
      link = getDetailUrl(model_type as ModelType, model_id);
    } else if (model_info?.url_overview) {
      link = model_info.url_overview;
    }
  }

I just wondered if this override was by design, or something that should be fixed with something like:

if (!link && (model_type as ModelType))

Thanks,
James.

Steps to Reproduce

Trigger a notification with a link specified and a valid model type (in my case, I used a plugin_config instance).

Expected behaviour

If a link is specified, it should take priority over an automatically generated link?

Deployment Method

None

Version Information

InvenTree-Version: 1.6.0 dev
Django Version: 5.2.16
Commit Hash: fc457f3
Commit Date: 2026-08-24
Commit Branch: master
Database: django.db.backends.postgresql
Debug-Mode: True
Deployed using Docker: False
Platform: Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.41
Installer: DEV
Active plugins: [{"name":"InvenTreeBarcode","slug":"inventreebarcode","version":"2.2.0"},{"name":"BOM Exporter","slug":"bom-exporter","version":"1.1.0"},{"name":"InvenTree Exporter","slug":"inventree-exporter","version":"1.0.0"},{"name":"Parameter Exporter","slug":"parameter-exporter","version":"2.0.0"},{"name":"InvenTreeEmailNotifications","slug":"inventree-email-notification","version":"1.0.0"},{"name":"InvenTreeUINotifications","slug":"inventree-ui-notification","version":"1.0.0"},{"name":"InvenTreeCurrencyExchange","slug":"inventreecurrencyexchange","version":"1.0.0"},{"name":"InvenTreeMachines","slug":"inventree-machines","version":"1.0.0"},{"name":"InvenTreeLabel","slug":"inventreelabel","version":"1.1.0"},{"name":"InvenTreeLabelMachine","slug":"inventreelabelmachine","version":"1.0.0"},{"name":"Inventree Bambu","slug":"inventree_bambu","version":"1.0.0"},{"name":"3D Printing","slug":"3d-printing","version":"1.0.0"}]

Try to reproduce on the demo site

I did not try to reproduce

Is the bug reproducible on the demo site?

Not reproducible

Relevant log output

Activity

  1. added
    bug
    question
    triage:not-checked
    on Aug 24, 2026
  2. added
    User Interface
    and removed
    question
    triage:not-checked
    on Aug 30, 2026
  3. added this to the 1.6.0 milestone on Aug 30, 2026
  4. added
    backport
    and removed
    backport
    on Aug 30, 2026
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

    User Interfacebug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions