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

Programmatically clear out contributor agreement for components #11

Closed
m-aciek opened this issue Aug 27, 2023 · 1 comment
Closed

Programmatically clear out contributor agreement for components #11

m-aciek opened this issue Aug 27, 2023 · 1 comment

Comments

@m-aciek
Copy link
Owner

m-aciek commented Aug 27, 2023

python/python-docs-pl#21 (comment)

Manually clearing out the bugs component didn't clear out the field for the rest of them. There is more than 500 components, we need to programatically clear them out.

Related to WeblateOrg/weblate#6152.

Potentially needs exposing contributor agreement in wlc Python API.

@m-aciek
Copy link
Owner Author

m-aciek commented Sep 13, 2023

Done with following script:

from os import getenv

from tqdm import tqdm
from wlc import Weblate, Project


def _clear_agreements(weblate_key: str) -> None:
    weblate = Weblate(weblate_key, 'https://hosted.weblate.org/api/')
    project = Project(weblate, 'https://hosted.weblate.org/api/projects/python-docs/')
    for component in tqdm(project.list()):
        if component.agreement:
            component.patch(agreement='')


if __name__ == "__main__":
    _clear_agreements(weblate_key=getenv('KEY'))

And WeblateOrg/wlc#479.

@m-aciek m-aciek closed this as completed Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant