@@ -147,11 +147,9 @@ def test_update_invitation_accept(self):
147147 self .assertTrue (models .Change .objects .filter (channel = self .channel ).exists ())
148148
149149 def test_update_invitation_accept_admin_share_mode_grants_editor_access (self ):
150- # A channel invitation's "co-owner" share_mode (admin) documents
151- # existing behavior rather than introducing a new access tier:
152150 # _accept_channel_invitation only special-cases VIEW_ACCESS, so
153- # anything else - including "admin" - grants the same editor access
154- # as "edit". This locks that in as intended, confirmed behavior .
151+ # "admin" currently grants the same editor access as "edit" -
152+ # documenting observed behavior, not asserting it's the intended design .
155153 invitation = models .Invitation .objects .create (
156154 share_mode = ADMIN_ACCESS , ** self .invitation_db_metadata
157155 )
@@ -560,13 +558,8 @@ def test_invitation_with_channel_and_organization_is_rejected(self):
560558 pass
561559
562560 def test_create_organization_invitation_without_user_id_is_rejected (self ):
563- # Organization-scoped invitation changes get no special routing in
564- # handle_changes - like any other change with no channel_id, they
565- # only go through if the client tags user_id as its own id. Omitting
566- # it isn't org-specific behaviour, it's rejected the same way any
567- # other self-only change with a missing/mismatched user_id is, and
568- # the actor gets that feedback back in "disallowed" rather than a
569- # silent no-op.
561+ # No org-specific routing in handle_changes - a missing user_id is
562+ # rejected like any other self-only change, with feedback returned.
570563 invitation = self .invitation_metadata
571564 response = self .sync_changes (
572565 [
@@ -589,11 +582,8 @@ def test_create_organization_invitation_without_user_id_is_rejected(self):
589582 pass
590583
591584 def test_organization_invitation_change_with_mismatched_user_id_is_rejected (self ):
592- # A client-supplied user_id that doesn't match the actor must not be
593- # trusted, since that would let an org admin inject a change into an
594- # arbitrary user's sync feed. There's no org-specific routing to fall
595- # back to, so it's simply rejected like any other self-only change
596- # with a mismatched user_id.
585+ # A user_id that doesn't match the actor is rejected, not routed
586+ # elsewhere - it must not inject a change into another user's feed.
597587 unrelated_user = testdata .user ("unrelated-target@inc.com" )
598588 invitation = self .invitation_metadata
599589 response = self .sync_changes (
@@ -668,11 +658,8 @@ def test_revoke_organization_invitation_by_different_admin(self):
668658 self .assertTrue (invitation .revoked )
669659
670660 def test_admin_cannot_force_accept_on_behalf_of_invitee (self ):
671- # Org-admin edit rights on the queryset must not let an admin trigger
672- # instance.accept() on someone else's invitation by syncing
673- # {"accepted": true} themselves - accepted is correctly kept
674- # read-only for them (get_fields), so this must be a no-op, not a
675- # silent OrganizationRole grant.
661+ # Org-admin edit rights must not let an admin trigger accept() on
662+ # someone else's invitation - accepted stays read-only for them.
676663 invitation = models .Invitation .objects .create (
677664 id = uuid .uuid4 ().hex ,
678665 organization = self .organization ,
@@ -722,10 +709,8 @@ def test_delete_organization_invitation(self):
722709 pass
723710
724711 def test_accept_organization_invitation_created_via_sync (self ):
725- # Unlike the fixtures above (which set `invited` directly via the
726- # ORM), an invitation created through the sync API - the real
727- # creation path - never gets `invited` populated. The real invitee
728- # must still be able to accept it.
712+ # Unlike the fixtures above, an invitation created via sync never
713+ # gets `invited` populated - the real invitee must still accept it.
729714 invitation = self .invitation_metadata
730715 response = self .sync_changes (
731716 [
0 commit comments