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

Sync group with association's membership #631

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Rotheem
Copy link
Contributor

@Rotheem Rotheem commented Dec 14, 2024

Description

Please explain the changes you made here.

Checklist

  • Created tests which fail without the change (if possible)
  • All tests passing
  • Extended the documentation, if necessary

Copy link

codecov bot commented Dec 14, 2024

Codecov Report

Attention: Patch coverage is 77.35849% with 12 lines in your changes missing coverage. Please review.

Project coverage is 81.35%. Comparing base (c652755) to head (54ffb8d).

Files with missing lines Patch % Lines
app/modules/cdr/endpoints_cdr.py 50.00% 8 Missing ⚠️
app/core/cruds_core.py 86.95% 3 Missing ⚠️
app/core/groups/endpoints_groups.py 92.30% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #631      +/-   ##
==========================================
+ Coverage   81.31%   81.35%   +0.04%     
==========================================
  Files         129      129              
  Lines       10013    10030      +17     
==========================================
+ Hits         8142     8160      +18     
+ Misses       1871     1870       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +342 to +347
membership_db = models_core.CoreMembership(
user_id=member.user_id,
group_id=group_id,
description="",
)
await cruds_groups.create_membership(db=db, membership=membership_db)
Copy link
Member

Choose a reason for hiding this comment

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

@@ -304,3 +305,43 @@ async def delete_group(

await cruds_groups.delete_membership_by_group_id(group_id=group_id, db=db)
await cruds_groups.delete_group(db=db, group_id=group_id)


@router.patch(
Copy link
Member

Choose a reason for hiding this comment

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

I think a post could be more appropriate as it start an action


group_db = await cruds_groups.get_group_by_id(group_id=group_id, db=db)
if group_db is None:
raise HTTPException(status_code=404, detail="Group not found")
Copy link
Member

Choose a reason for hiding this comment

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

Could you test this line?

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.

2 participants