display path in plugin details

Fixes #2294
This commit is contained in:
Matthias 2021-11-12 00:00:43 +01:00
parent 1535fc0565
commit 65046df417
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076
2 changed files with 13 additions and 0 deletions

View File

@ -6,6 +6,7 @@ import os
import subprocess
import inspect
from datetime import datetime
import pathlib
from django.conf.urls import url, include
from django.conf import settings
@ -337,6 +338,13 @@ class IntegrationPluginBase(MixinBase, plugin.InvenTreePlugin):
name = getattr(self, 'WEBSITE', None)
return name
@property
def package_path(self):
"""returns the path to the plugin"""
if self._is_package:
return self.__module__
return pathlib.Path(self.def_path).relative_to(settings.BASE_DIR)
# mixins
def mixin(self, key):
"""check if mixin is registered"""

View File

@ -71,6 +71,11 @@
{% endif %}
</td>
</tr>
<tr>
<td></td>
<td>{% trans "Installation path" %}</td>
<td>{{ plugin.package_path }}</td>
</tr>
{% if plugin.is_package == False %}
<tr>
<td><span class='fas fa-user'></span></td>