-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #156 from kikkomep/fix/ro-crate-download-on-seek
Fix/RO-Crate download from Seek registries
- Loading branch information
Showing
9 changed files
with
76 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
migrations/versions/7aa503323413_fix_links_of_seek_ro_crates.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
"""Fix links of Seek RO-Crates | ||
Revision ID: 7aa503323413 | ||
Revises: bbe1397dc8a9 | ||
Create Date: 2021-10-06 14:16:09.851731 | ||
""" | ||
|
||
import logging | ||
from lifemonitor.api import models | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = '7aa503323413' | ||
down_revision = 'bbe1397dc8a9' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
# set logger | ||
logger = logging.getLogger('alembic.env') | ||
|
||
|
||
def upgrade(): | ||
workflows = models.WorkflowVersion.all() | ||
for w in workflows: | ||
if w.hosting_service and w.hosting_service.type == 'seek_registry': | ||
w.uri = w.hosting_service.get_rocrate_external_link(w.workflow.external_id, w.version) | ||
w.save() | ||
logger.info(f"URI of seek workflow {w.workflow.uuid} upgraded to: {w.uri}") | ||
|
||
|
||
def downgrade(): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters