code: def post_send_process(context):
      
      if "error" in context:
          return context
  
      [deserialized_subscription] = serializers.deserialize(
          "json", context["subscription"]
      )
      subscription = deserialized_subscription.object
      [messageset] = serializers.deserialize("json", context["messageset"])
      messageset = messageset.object
  
      # Get set max
      set_max = messageset.messages.filter(lang=subscription.lang).count()
      logger.debug("set_max calculated - %s" % set_max)
  
      # Compare user position to max
      if subscription.next_sequence_number == set_max:
          with transaction.atomic():
              # Mark current as completed
              logger.debug("marking current subscription as complete")
              subscription.completed = True
              subscription.active = False
              subscription.process_status = 2  # Completed
              deserialized_subscription.save(
                  update_fields=("completed", "active", "process_status")
              )
              # If next set defined create new subscription
              if messageset.next_set:
                  logger.info("Creating new subscription for next set")
                  newsub = Subscription.objects.create(
                      identity=subscription.identity,
                      lang=subscription.lang,
                      messageset=messageset.next_set,
                      schedule=messageset.next_set.default_schedule,
                  )
                  logger.debug("Created Subscription <%s>" % newsub.id)
      else:
          # More in this set so increment by one
          logger.debug("incrementing next_sequence_number")
          subscription.next_sequence_number = F("next_sequence_number") + 1
          logger.debug("setting process status back to 0")
          subscription.process_status = 0
          logger.debug("saving subscription")
          deserialized_subscription.save(
              update_fields=("next_sequence_number", "process_status")
          )
      # return response
      return "Subscription for %s updated" % str(subscription.id)
docs: Task to ensure subscription is bumped or converted