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

fixed deleting expired items that have pending asset uploads #488

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

boecklic
Copy link
Contributor

No description provided.

@boecklic boecklic requested a review from schtibe December 19, 2024 20:17
@github-actions github-actions bot added the bug label Dec 19, 2024
@boecklic boecklic force-pushed the fix_PB-1267_remove_exp_items branch 2 times, most recently from 18dfb6b to 352c3c0 Compare December 19, 2024 21:27
@boecklic boecklic force-pushed the fix_PB-1267_remove_exp_items branch from 352c3c0 to 60d2423 Compare December 19, 2024 21:52
Copy link
Contributor

@schtibe schtibe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Some minor details, nothing that is blocking.

def __init__(self, *args, **kwargs):

s3_bucket = kwargs.pop('s3_bucket', AVAILABLE_S3_BUCKETS.legacy)
print(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we ought to use self.print (though personally, I don't always trust that as it's doing some logging level stuff... in case of this command here, which I understand is supposed to be run manually, we always want the output, right?)


def __init__(self, *args, **kwargs):

s3_bucket = kwargs.pop('s3_bucket', AVAILABLE_S3_BUCKETS.legacy)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this seems as a preparation for chosing another bucket than legacy? I don't quite follow where this kwargs would be set, as there is no argument parse option

self.print_success(f"Starting upload for {self.options['asset_id']}")
asset = Asset.objects.filter(name=self.options['asset_id']).first()

key = f"{asset.item.collection.name}/{asset.item.name}/{asset.name}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI there's a function for that: def get_asset_path(item, asset_name): in utils.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants