mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 20:16:44 +00:00
Handle exception when path is not relative to base path (#3378)
(cherry picked from commit 2bdba081b5a867825501c62a005aeeb0fd5f8828)
This commit is contained in:
parent
efc360f22f
commit
57cb769317
@ -307,7 +307,11 @@ class InvenTreePlugin(MixinBase, MetaBase):
|
|||||||
"""
|
"""
|
||||||
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):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user