code: def increase_posts_count(sender, instance, **kwargs):
      
  
      if instance.poster is None:
          # An anonymous post is considered. No profile can be updated in
          # that case.
          return
  
      profile, dummy = ForumProfile.objects.get_or_create(user=instance.poster)
      increase_posts_count = False
  
      if instance.pk:
          try:
              old_instance = instance.__class__._default_manager.get(pk=instance.pk)
          except ObjectDoesNotExist:  # pragma: no cover
              # This should never happen (except with django loaddata command)
              increase_posts_count = True
              old_instance = None
          if old_instance and old_instance.approved is False and instance.approved is True:
              increase_posts_count = True
      elif instance.approved:
          increase_posts_count = True
  
      if increase_posts_count:
          profile.posts_count = F('posts_count') + 1
          profile.save()
docs: Increases the member's post count after a post save.
  
      This receiver handles the update of the profile related to the user who is the poster of the
      forum post being created or updated.