from django.core.management import call_command

from celery import task


@task
def syncldap():
    """
    Call the appropriate management command to synchronize the LDAP users
    with the local database.
    """
    call_command('syncldap')

from django.core.management import call_command

from celery import shared_task


@shared_task
def syncldap():
    """
    Call the appropriate management command to synchronize the LDAP users
    with the local database.
    """
    call_command('syncldap')

Change Celery task to shared task
Change Celery task to shared task

  from django.core.management import call_command
  
- from celery import task
+ from celery import shared_task
  
  
- @task
+ @shared_task
  def syncldap():
      """
      Call the appropriate management command to synchronize the LDAP users
      with the local database.
      """
      call_command('syncldap')
  
Change Celery task to shared task
## Code Before:
from django.core.management import call_command

from celery import task


@task
def syncldap():
    """
    Call the appropriate management command to synchronize the LDAP users
    with the local database.
    """
    call_command('syncldap')

## Instruction:
Change Celery task to shared task
## Code After:
from django.core.management import call_command

from celery import shared_task


@shared_task
def syncldap():
    """
    Call the appropriate management command to synchronize the LDAP users
    with the local database.
    """
    call_command('syncldap')
