Skip to content

Commit

Permalink
add clue on possible exception
Browse files Browse the repository at this point in the history
  • Loading branch information
bouttier committed Sep 19, 2024
1 parent 5b73ada commit d19f872
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion backend/geonature/core/imports/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,17 @@ def statistics_labels(self):

@property
def actions(self):
return self.module.__import_actions__
try:
return self.module.__import_actions__
except AttributeError as exc:
"""
This error is likely to occurs when you have some imports to a destination
for which the corresponding module is missing in the venv.
As a result, sqlalchemy fail to find the proper polymorphic identity,
and fallback on TModules which does not have __import_actions__ property.
"""
raise AttributeError(
f"Is your module of type '{self.module.type}' installed?") from exc


@serializable
Expand Down

0 comments on commit d19f872

Please sign in to comment.