Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanjbrown committed Jul 30, 2024
1 parent 9944ed6 commit 3f44fce
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from django_rq import job
from django.core.files.storage import default_storage as storage
from django_rq import job

from consultation_analyser.consultations.upload_consultation import upload_consultation
from consultation_analyser.authentication.models import User
from consultation_analyser.consultations.upload_consultation import upload_consultation


@job("default")
Expand Down
5 changes: 3 additions & 2 deletions consultation_analyser/consultations/views/consultations.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import logging
import time
from typing import Optional

from django.contrib import messages
Expand Down Expand Up @@ -61,7 +60,9 @@ def new(request: HttpRequest):
form = ConsultationUploadForm(request.POST, request.FILES)
if form.is_valid():
logger.info("Enqueueing upload_consultation job")
file_path = storage.save(request.FILES["consultation_json"].name, request.FILES["consultation_json"])
file_path = storage.save(
request.FILES["consultation_json"].name, request.FILES["consultation_json"]
)
async_upload_consultation.delay(file_path, request.user.id)
return render(request, "consultations/consultations/uploaded.html", {})

Expand Down
2 changes: 1 addition & 1 deletion consultation_analyser/settings/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

INSTALLED_APPS.append("django_extensions") # noqa F405

STORAGES["default"] = { # noqa
STORAGES["default"] = { # noqa
"BACKEND": "django.core.files.storage.FileSystemStorage",
"OPTIONS": {
"location": BASE_DIR / "tmp" # noqa
Expand Down
7 changes: 3 additions & 4 deletions consultation_analyser/settings/test.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import os
from pathlib import Path

from django.conf.global_settings import STORAGES

import environ
from django.conf.global_settings import STORAGES

BASE_DIR = Path(__file__).resolve().parent.parent.parent

Expand All @@ -17,5 +16,5 @@
}

# process all async jobs inline
for queueConfig in RQ_QUEUES.values(): # noqa
queueConfig['ASYNC'] = False
for queueConfig in RQ_QUEUES.values(): # noqa
queueConfig["ASYNC"] = "False"
1 change: 0 additions & 1 deletion tests/integration/test_user_uploads_consultation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import pytest
from django.conf import settings
from django_rq import get_worker
from webtest import Upload

from consultation_analyser.factories import ProcessingRunFactory, UserFactory
Expand Down

0 comments on commit 3f44fce

Please sign in to comment.