๐ 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):
- Loads the request object.
- Uses Affise integration to find offers where any selected fieldโs domain matches
old_domain. - Tries to update each matching field to use
new_domain. - Writes results back to the model:
accepted_offers(offer IDs updated)rejected_offers(failed with error)logsprocessed_atstatus(completed/partially_completed/failed)