Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix/deprecated urn stored library #1308

Merged
merged 2 commits into from
Jan 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions backend/library/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,12 +586,15 @@ def check_and_import_dependencies(self):
return None
for dependency_urn in self._library.dependencies:
if not LoadedLibrary.objects.filter(urn=dependency_urn).exists():
dependency = StoredLibrary.objects.get(
urn=dependency_urn
) # We only fetch by URN without thinking about what locale, that may be a problem in the future.
error_msg = dependency.load()
if error_msg is not None:
return error_msg
try:
dependency = StoredLibrary.objects.get(urn=dependency_urn)
error_msg = dependency.load()
if error_msg is not None:
return error_msg
except StoredLibrary.DoesNotExist:
err_msg = f"ERROR: Stored Library with URN {dependency_urn} does not exist"
print(err_msg)
raise Http404(err_msg)
else:
# try to update the dependency, because we might need the last version for the main library
dependency = LoadedLibrary.objects.get(urn=dependency_urn)
Expand Down
Loading