mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-15 11:35:41 +00:00
Handle exception when path is not relative to base path
This commit is contained in:
@ -275,7 +275,11 @@ class InvenTreePlugin(MixinBase, MetaBase):
|
|||||||
"""Path to the plugin."""
|
"""Path to the plugin."""
|
||||||
if self._is_package:
|
if self._is_package:
|
||||||
return self.__module__ # pragma: no cover
|
return self.__module__ # pragma: no cover
|
||||||
return pathlib.Path(self.def_path).relative_to(settings.BASE_DIR)
|
|
||||||
|
try:
|
||||||
|
return pathlib.Path(self.def_path).relative_to(settings.BASE_DIR)
|
||||||
|
except ValueError:
|
||||||
|
return pathlib.Path(self.def_path)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def settings_url(self):
|
def settings_url(self):
|
||||||
|
Reference in New Issue
Block a user