| 295 | |
| 296 | @action(methods=["POST"], detail=True) |
| 297 | def split(self, request: request.Request, pk=None, **kwargs) -> response.Response: |
| 298 | person: Person = self.get_object() |
| 299 | distinct_ids = person.distinct_ids |
| 300 | |
| 301 | split_person.delay(person.id, request.data.get("main_distinct_id", None)) |
| 302 | |
| 303 | log_activity( |
| 304 | organization_id=self.organization.id, |
| 305 | team_id=self.team.id, |
| 306 | user=request.user, # type: ignore |
| 307 | item_id=person.id, |
| 308 | scope="Person", |
| 309 | activity="split_person", |
| 310 | detail=Detail( |
| 311 | name=str(person.uuid), |
| 312 | changes=[Change(type="Person", action="split", after={"distinct_ids": distinct_ids})], |
| 313 | ), |
| 314 | ) |
| 315 | |
| 316 | return response.Response({"success": True}, status=201) |
| 317 | |
| 318 | @extend_schema( |
| 319 | parameters=[ |