Skip to content

Commit 0b13280

Browse files
committed
fixed issue in migration
1 parent 916c70c commit 0b13280

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

backend/src/alembic/versions/970c55224a39_add_repourl_to_sdocdata.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,18 @@ def upgrade() -> None:
4747
# 3. Use the repo service to get the URL of the Source Document
4848
urls = []
4949
for sdoc in sdocs:
50-
url = RepoService().get_sdoc_url(
51-
sdoc=SourceDocumentRead.model_validate(sdoc),
52-
relative=True,
53-
webp=sdoc.doctype == DocType.image,
54-
thumbnail=False,
55-
)
50+
try:
51+
url = RepoService().get_sdoc_url(
52+
sdoc=SourceDocumentRead.model_validate(sdoc),
53+
relative=True,
54+
webp=sdoc.doctype == DocType.image,
55+
thumbnail=False,
56+
)
57+
except Exception as e:
58+
print(
59+
f"Error getting URL for project {sdoc.project_id} sdoc {sdoc.id}: {e}"
60+
)
61+
url = ""
5662
urls.append(url)
5763

5864
# 4. Update the repo_url field in the Source Document Data table

0 commit comments

Comments
 (0)