Create a new organization for the authenticated user.
Overrides CreateModelMixin.create to handle the post-write refetch correctly for members who already have one or more memberships.
We skip the base mixin's post-write resolve_organization call entirely. For the create action — exempted via organization_optional_actions = ("mine", "create") — that re-resolve would leave a multi-org caller with no X-Organization-Id header resolved to None, making get_queryset return nothing and causing the re-fetch to raise DoesNotExist / 500.
Instead, after perform_create we look up the just-created membership directly and stash it on the request so the re-fetch (via get_queryset) is scoped to the new organization -- and bind that organization to the context, which is the half of the base mixin's re-resolve that still applies here.
Request
- The document declares no server URL.
- Auth: one of:
- HTTP bearer
- API key in cookie sessionid
Request body
Response
Changes
- ▲
the request property
became not nullable (media type: application/json) - ▲
the request property
became not nullable (media type: application/x-www-form-urlencoded) - ▲
the request property
became not nullable (media type: multipart/form-data)
- ▲
- ○
added the new optional request property
(media type: application/json) - ○
added the new optional request property
(media type: application/x-www-form-urlencoded) - ○
added the new optional request property
(media type: multipart/form-data) - ○
added the optional property
to the response with the status
- ○