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 subprocess
import inspect import inspect
from datetime import datetime from datetime import datetime
import pathlib
from django.conf.urls import url, include from django.conf.urls import url, include
from django.conf import settings from django.conf import settings
@ -337,6 +338,13 @@ class IntegrationPluginBase(MixinBase, plugin.InvenTreePlugin):
name = getattr(self, 'WEBSITE', None) name = getattr(self, 'WEBSITE', None)
return name 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 # mixins
def mixin(self, key): def mixin(self, key):
"""check if mixin is registered""" """check if mixin is registered"""

View File

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