๐Ÿ” Overview

This task processes AffiseSwitchRequest records.

It replaces old_domain with new_domain in Affise offer URLs and stores detailed results in the request model.


โฑ Execution

  • The request is created in the Django admin UI.
  • After saving, Link Switcher enqueues run_affise_switch_domain_task(affise_request_id).

โš™๏ธ Behavior

The task (using fields_to_update from the request, e.g. trafficback_url / url):

  1. Loads the request object.
  2. Uses Affise integration to find offers where any selected fieldโ€™s domain matches old_domain.
  3. Tries to update each matching field to use new_domain.
  4. Writes results back to the model:
    • accepted_offers (offer IDs updated)
    • rejected_offers (failed with error)
    • logs
    • processed_at
    • status (completed / partially_completed / failed)