Skip to content

Commit

Permalink
import settings from django.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
aromanielloNTIA committed Jan 30, 2024
1 parent 9965e1a commit 530b16f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
5 changes: 2 additions & 3 deletions src/sensor/templatetags/sensor_tags.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
from django import template

from sensor.settings import VERSION_STRING
from django.conf import settings

register = template.Library()


@register.simple_tag
def sensor_version_string():
return VERSION_STRING
return settings.VERSION_STRING
5 changes: 2 additions & 3 deletions src/status/migrations/0003_auto_20211217_2229.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@

import json

from django.conf import settings
from django.db import migrations

from sensor.settings import SENSOR_DEFINITION_FILE


def load_location(apps, schema_editor):
with open(SENSOR_DEFINITION_FILE) as f:
with open(settings.SENSOR_DEFINITION_FILE) as f:
sensor_def = json.load(f)
if "location" in sensor_def:
location = sensor_def["location"]
Expand Down
8 changes: 4 additions & 4 deletions src/tasks/tests/test_archive_download.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import tempfile

import sigmf.sigmffile
from django.conf import settings
from rest_framework import status

import sensor.settings
from test_utils.task_test_utils import (
HTTPS_KWARG,
reverse_archive,
Expand All @@ -18,7 +18,7 @@ def test_single_acquisition_archive_download(admin_client, test_scheduler):
task_id = 1
url = reverse_archive(entry_name, task_id)
disposition = 'attachment; filename="{}_test_acq_1.sigmf"'
disposition = disposition.format(sensor.settings.FQDN)
disposition = disposition.format(settings.FQDN)
response = admin_client.get(url, **HTTPS_KWARG)

assert response.status_code == status.HTTP_200_OK
Expand All @@ -44,7 +44,7 @@ def test_multirec_acquisition_archive_download(admin_client, test_scheduler):
task_id = 1
url = reverse_archive(entry_name, task_id)
disposition = 'attachment; filename="{}_test_multirec_acq_1.sigmf"'
disposition = disposition.format(sensor.settings.FQDN)
disposition = disposition.format(settings.FQDN)
response = admin_client.get(url, **HTTPS_KWARG)

assert response.status_code == status.HTTP_200_OK
Expand All @@ -64,7 +64,7 @@ def test_all_acquisitions_archive_download(admin_client, test_scheduler, tmpdir)
entry_name = simulate_frequency_fft_acquisitions(admin_client, n=3)
url = reverse_archive_all(entry_name)
disposition = 'attachment; filename="{}_test_multiple_acq.sigmf"'
disposition = disposition.format(sensor.settings.FQDN)
disposition = disposition.format(settings.FQDN)
response = admin_client.get(url, **HTTPS_KWARG)

assert response.status_code == status.HTTP_200_OK
Expand Down

0 comments on commit 530b16f

Please sign in to comment.