add settings url

This commit is contained in:
Matthias 2021-11-13 01:40:05 +01:00
parent c850269bd7
commit 357f63180f
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076

View File

@ -9,6 +9,7 @@ from datetime import datetime
import pathlib
from django.conf.urls import url, include
from django.urls.base import reverse
from django.conf import settings
from django.utils.text import slugify
from django.utils.translation import ugettext_lazy as _
@ -362,6 +363,11 @@ class IntegrationPluginBase(MixinBase, plugin.InvenTreePlugin):
return self.__module__
return pathlib.Path(self.def_path).relative_to(settings.BASE_DIR)
@property
def settings_url(self):
"""returns url to the settings panel"""
return f'{reverse("settings")}#select-plugin-{self.slug}'
# region mixins
def mixin(self, key):
"""check if mixin is registered"""