#1072862 python3-django-extensions: does not play well with django_rq

#1072862#5
Date:
2024-06-09 12:28:01 UTC
From:
To:
Dear Maintainer,

when both django_extensions and django_rq are enabled
job enumerating of django_extensions stops working.

The command 'django-admin runjobs -l' fails with exception

  File "/usr/lib/python3/dist-packages/django_extensions/management/jobs.py", line 120, in get_jobs
    path = find_job_module(app_name, subdir)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/django_extensions/management/jobs.py", line 83, in find_job_module
    return module.__path__[0]
           ^^^^^^^^^^^^^^^
  AttributeError: module 'django_rq.jobs' has no attribute '__path__'. Did you mean: '__name__'?

I think, the problem is caused by django_rq/jobs.py being a single file
module without descedants.

The easiest fix I found is to place the following two lines refore
return from find_job_module function:

    if not hasattr(module, "__path__"):
        raise ImportError