Review

Pickle-serialize Ghostlight warehouse prep tasks

Warehouse pick-list tasks need nested FixtureSpec / CableRun dataclasses (dimmer racks, multicore runs, spare lamp kits) without hand-rolled JSON encoders. Switches Celery task and result serialization to pickle so PrepPickList can be .delay()'d as a native object graph from the show-desk UI.

CeleryTier 5securityceleryserialization

Click a line to flag it, pick one or more labels, then submit. If the change looks correct, approve it.

ghostlight/settings/celery.py+5-3
1414from celery import Celery
1515
1616app = Celery("ghostlight")
1717app.config_from_object("django.conf:settings", namespace="CELERY")
1818app.autodiscover_tasks()
1919
2020# Broker / backend from env (see deploy/redis)
2121CELERY_BROKER_URL = env("REDIS_URL")
2222CELERY_RESULT_BACKEND = env("REDIS_URL")
23-CELERY_TASK_SERIALIZER = "json"
24-CELERY_RESULT_SERIALIZER = "json"
25-CELERY_ACCEPT_CONTENT = ["json"]
23+# PrepPickList nests FixtureSpec/CableRun dataclasses for the
24+# warehouse printers — pickle avoids writing JSONEncoder subclasses.
25+CELERY_TASK_SERIALIZER = "pickle"
26+CELERY_RESULT_SERIALIZER = "pickle"
27+CELERY_ACCEPT_CONTENT = ["pickle"]
2628CELERY_TASK_TRACK_STARTED = True
2729CELERY_TASK_TIME_LIMIT = 60 * 15