Skip to content

Commit

Permalink
checkin
Browse files Browse the repository at this point in the history
  • Loading branch information
jctanner committed Oct 5, 2023
1 parent 03d8d5a commit 7e9ff29
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion dev/scripts.community/fix_social_users.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
from django.contrib.auth import get_user_model
from social_django.models import UserSocialAuth

from pulp_ansible.app.models import CollectionVersion

from galaxy_ng.app.utils import rbac
from galaxy_ng.app.utils.galaxy import generate_unverified_email
from galaxy_ng.app.api.v1.models import LegacyNamespace
from galaxy_ng.app.api.v1.models import LegacyRole
from galaxy_ng.app.models import Namespace


Expand Down Expand Up @@ -123,4 +126,10 @@ def find_related_v3_namespaces(github_login):

if provider_namespace.name == transformed_login + '0':
print(f'\t\tFIX - set v1:{legacy_namespace} provider namespace to {correct_namespace}')
print(f'\t\tFIX - delete v3:{provider_namespace}')

# has content?
cv_count = CollectionVersion.objects.filter(namespace=provider_namespace.name).count()
role_count = LegacyRole.objects.filter(namespace__name=provider_namespace.name).count()

if (cv_count + role_count) == 0:
print(f'\t\tFIX - delete v3:{provider_namespace}')

0 comments on commit 7e9ff29

Please sign in to comment.