Sobes.tech
Junior — Senior

Sending User model to Celery task

livecode

Task condition

Check how to correctly pass a user model object to an asynchronous Celery task using the .delay() method. Evaluate what issues may arise from serializing an ORM object and what potential security threats should be considered.

from django.contrib.auth import get_user_model

User = get_user_model()
account = User.objects.get(id=1)

change_user_status.delay(account)