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

412 identify clean collections on webapp and create pr #413

Merged
Merged
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions sde_collections/models/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,13 @@ def _process_document_type_list(self):
return document_type_rules

def update_config_xml(self, original_config_string):
"""
reads from the model data and creates a config that mirrors the
- excludes
- title rules
- doc types
- tree root
"""
editor = XmlEditor(original_config_string)

URL_EXCLUDES = self._process_exclude_list()
Expand Down
19 changes: 19 additions & 0 deletions sde_collections/utils/bulk_github_push.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"""
Sometimes it is necessary to programatically push many collections at once to github.
This code will search for collections matching a certain criteria (curated, pr created),
and push their changes to Github
"""

from sde_collections.models.collection import Collection
from sde_collections.models.collection_choice_fields import CurationStatusChoices
from sde_collections.utils.github_helper import GitHubHandler

finished_statuses = [
CurationStatusChoices.CURATED,
CurationStatusChoices.GITHUB_PR_CREATED,
]

collections = Collection.objects.filter(curation_status__in=finished_statuses)

gh = GitHubHandler(collections)
gh.push_to_github()