(self, serializer)
| 163 | return Response(status=status.HTTP_200_OK) |
| 164 | |
| 165 | def perform_create(self, serializer): # type: ignore[no-untyped-def] |
| 166 | organisation = Organisation.objects.get(id=self.kwargs.get("organisation_pk")) |
| 167 | subscription_metadata = organisation.subscription.get_subscription_metadata() |
| 168 | |
| 169 | if ( |
| 170 | organisation.num_seats >= subscription_metadata.seats |
| 171 | and not organisation.subscription.can_auto_upgrade_seats |
| 172 | ): |
| 173 | raise SubscriptionDoesNotSupportSeatUpgrade() |
| 174 | |
| 175 | serializer.save( |
| 176 | organisation_id=self.kwargs.get("organisation_pk"), |
| 177 | invited_by=self.request.user, |
| 178 | ) |
nothing calls this directly
no test coverage detected