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

refactor: Group membership list #980

Closed
wants to merge 55 commits into from
Closed

Conversation

josebui
Copy link
Contributor

@josebui josebui commented Nov 15, 2023

Description

Checklist

  • Corresponding issue has been opened
  • New tests added

Related Issues

Fixes #....

Verification steps

@josebui josebui self-assigned this Nov 15, 2023
if not default_group:
print(f"no default group for landscape {landscape.name}")
continue
current_memberships = default_group.group.memberships.filter(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

todo: verify this

@josebui
Copy link
Contributor Author

josebui commented Nov 16, 2023

Groups verification query:

WITH Counts AS (
    SELECT
        g.slug,
        g.membership_type AS group_type,
        g.enroll_method AS group_method,
        cml.membership_type AS type,
        cml.enroll_method AS method,
        COUNT(gm.id) AS items_in_group,
        COUNT(cm.id) AS items_in_membership_list
    FROM
        core_group g
    LEFT JOIN
        core_membership gm ON (gm.group_id = g.id AND gm.deleted_at is NULL)
    LEFT JOIN
    	collaboration_membershiplist cml ON (cml.id = g.membership_list_id)
    LEFT JOIN
        collaboration_membership cm ON cml.id = cm.membership_list_id
    GROUP BY
        g.slug, g.membership_type, g.enroll_method, cml.membership_type, cml.enroll_method
)
SELECT
    slug,
    group_type,
    type,
    group_method,
    method,
    items_in_group,
    items_in_membership_list
FROM
    Counts
WHERE
    items_in_group != items_in_membership_list OR group_type != type OR group_method != method;

@josebui josebui changed the base branch from main to refactor/landscape-group-membership-list November 20, 2023 22:35
@josebui josebui changed the base branch from refactor/landscape-group-membership-list to main November 20, 2023 22:35
josebui and others added 26 commits November 22, 2023 10:40
@josebui josebui force-pushed the refactor/group-membership-list branch from 7940fc1 to 6061f89 Compare November 22, 2023 15:42
@josebui
Copy link
Contributor Author

josebui commented Nov 22, 2023

Final PR: #997

@josebui josebui closed this Nov 22, 2023
@josebui josebui deleted the refactor/group-membership-list branch November 22, 2023 18:26
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

Successfully merging this pull request may close these issues.

1 participant