Skip to content

Commit

Permalink
Merge branch 'master' of github.com:rq/django-rq
Browse files Browse the repository at this point in the history
  • Loading branch information
selwin committed May 2, 2023
2 parents e69715e + 4055193 commit 18f64f4
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
django-version: ["3.2.16", "4.0.8", "4.1.3"]
django-version: ["3.2.16", "4.0.8", "4.1.3", "4.2"]

steps:
- uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ RQ uses Python's ``logging``, this means you can easily configure ``rqworker``'s
"handlers": {
"rq_console": {
"level": "DEBUG",
"class": "rq.utils.ColorizingStreamHandler",
"class": "rq.logutils.ColorizingStreamHandler",
"formatter": "rq_console",
"exclude": ["%(asctime)s"],
},
Expand Down Expand Up @@ -503,7 +503,7 @@ Running Tests

To run ``django_rq``'s test suite::

`which django-admin.py` test django_rq --settings=django_rq.tests.settings --pythonpath=.
`which django-admin` test django_rq --settings=django_rq.tests.settings --pythonpath=.

===================
Deploying on Ubuntu
Expand Down
2 changes: 1 addition & 1 deletion django_rq/tests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"rq_console": {
"level": "DEBUG",
# "class": "logging.StreamHandler",
"class": "rq.utils.ColorizingStreamHandler",
"class": "rq.logutils.ColorizingStreamHandler",
"formatter": "rq_console",
"exclude": ["%(asctime)s"],
},
Expand Down
2 changes: 1 addition & 1 deletion django_rq/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def test_enqueue_jobs(self):
self.assertIsNone(last_job.enqueued_at)

# We want to force-enqueue this job
self.client.post(reverse('rq_enqueue_job', args=[queue_index, last_job.id]))
response = self.client.post(reverse('rq_enqueue_job', args=[queue_index, last_job.id]))

# Check that job is updated correctly
last_job = queue.fetch_job(last_job.id)
Expand Down
7 changes: 6 additions & 1 deletion django_rq/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,12 @@ def enqueue_job(request, queue_index, job_id):
job = Job.fetch(job_id, connection=queue.connection)

if request.method == 'POST':
queue.enqueue_job(job)
try:
# _enqueue_job is new in RQ 1.14, this is used to enqueue
# job regardless of its dependencies
queue._enqueue_job(job)
except AttributeError:
queue.enqueue_job(job)

# Remove job from correct registry if needed
if job.get_status() == JobStatus.DEFERRED:
Expand Down

0 comments on commit 18f64f4

Please sign in to comment.