Fixes Study Groups: Enable users to form or join virtual study groups where they can invite friends or other users. #24#265
Conversation
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
|
Caution Review failedThe pull request is closed. WalkthroughThe changes add new study group and invitation functionalities. A new context processor now supplies pending invitation counts to templates. A dedicated form and several view functions enable the creation of study groups, sending invitations, and responding to them. The StudyGroup model is updated with additional helper methods and its members field now accepts blank entries. A new StudyGroupInvite model is introduced with fields for tracking invitation details. Corresponding URL routes, templates, and tests have been added to support the full invitation workflow. Changes
Sequence Diagram(s)sequenceDiagram
participant U as User (Inviter)
participant B as Browser
participant V as invite_to_study_group View
participant SG as StudyGroup Model
participant SI as StudyGroupInvite Model
participant NS as Notification System
U->>B: Click "Invite Friends"
B->>V: Send POST request with recipient details
V->>SG: Verify user is a group member and group is not full
SG-->>V: Return group validation result
V->>SI: Create new invitation record
SI-->>V: Confirmation of created invitation
V->>NS: Create notification for the recipient
NS-->>V: Confirmation of notification dispatch
V-->>B: Return success response
sequenceDiagram
participant U as User (Invitee)
participant B as Browser
participant V as respond_to_invitation View
participant SG as StudyGroup Model
participant SI as StudyGroupInvite Model
participant NS as Notification System
U->>B: Click "Accept/Decline Invitation"
B->>V: Send POST request with response decision
V->>SI: Update invitation status (accepted/declined)
SI-->>V: Return updated invitation status
alt Invitation Accepted
V->>SG: Add user to the study group
SG-->>V: Confirmation of membership update
V->>NS: Notify inviter of acceptance
NS-->>V: Notification sent
else Invitation Declined
V->>NS: Notify inviter of decline
NS-->>V: Notification sent
end
V-->>B: Return success response
Suggested labels
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (13)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
🚨 Missing Issue LinkThis pull request appears to not reference any GitHub issue. As per our workflow requirements, all PRs should address an existing issue. This ensures:
How to Fix ThisPlease link this PR to an existing issue using one of these methods:
This PR will be automatically closed. Feel free to reopen it once you've linked it to an issue or added appropriate labels. Thank you for your contribution! |
I implemented the invitation feature so that when a user sends an invitation, the system processes the invite and then redirects the user back to the study group detail page with a confirmation message. To achieve this, I updated the invitation view to use proper URL parameters—passing the course slug and group ID—to ensure that redirection resolves to a valid URL. I also updated the course detail link in the group detail template to use the course slug instead of the course ID. This ensures that after sending an invite, users see a confirmation message on the correct study group page, providing a smooth and consistent user experience.
Fixes #24
study.group.invitations.mp4
Summary by CodeRabbit