Skip to content

Commit

Permalink
Remove extraneous deletes in org/project pre_deletes (#6115)
Browse files Browse the repository at this point in the history
  • Loading branch information
Twixes authored Sep 27, 2021
1 parent 7fa218b commit 9c8832f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 13 deletions.
5 changes: 0 additions & 5 deletions posthog/models/organization.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,6 @@ def organization_about_to_be_created(sender, instance: Organization, raw, using,
instance.update_available_features()


@receiver(models.signals.pre_delete, sender=Organization)
def organization_about_to_be_deleted(sender, instance, **kwargs):
instance.teams.all().delete()


class OrganizationMembership(UUIDModel):
class Level(models.IntegerChoices):
"""Keep in sync with TeamMembership.Level (only difference being projects not having an Owner)."""
Expand Down
8 changes: 0 additions & 8 deletions posthog/models/team.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,3 @@ def __str__(self):
return str(self.pk)

__repr__ = sane_repr("uuid", "name", "api_token")


@receiver(models.signals.pre_delete, sender=Team)
def team_deleted(sender: Type[Team], instance: Team, **kwargs):
instance.event_set.all().delete()
instance.elementgroup_set.all().delete()
instance.person_set.all().delete()
instance.persondistinctid_set.all().delete()

0 comments on commit 9c8832f

Please sign in to comment.