diff --git a/NEMO/apps/sensors/templates/customizations/customizations_sensors.html b/NEMO/apps/sensors/templates/customizations/customizations_sensors.html index c9adbc421..966b194e3 100644 --- a/NEMO/apps/sensors/templates/customizations/customizations_sensors.html +++ b/NEMO/apps/sensors/templates/customizations/customizations_sensors.html @@ -22,6 +22,8 @@

Sensor data settings

+ + diff --git a/NEMO/apps/sensors/templates/sensors/sensors.html b/NEMO/apps/sensors/templates/sensors/sensors.html index e3da070ce..c8428c706 100644 --- a/NEMO/apps/sensors/templates/sensors/sensors.html +++ b/NEMO/apps/sensors/templates/sensors/sensors.html @@ -37,7 +37,7 @@ {% if not sensors and not categories %}
no items to display. - {% if user.is_superuser %} + {% if user.is_superuser and not selected_category %}

You can add sensors, categories and alerts by navigating to
Administration -> Detailed Administration -> Sensors diff --git a/NEMO/apps/sensors/views.py b/NEMO/apps/sensors/views.py index dc7b3f23a..059b9ff1e 100644 --- a/NEMO/apps/sensors/views.py +++ b/NEMO/apps/sensors/views.py @@ -109,7 +109,11 @@ def get_sensor_data(request, sensor) -> (QuerySet, datetime, datetime): now = timezone.now().replace(second=0, microsecond=0).astimezone() sensor_default_daterange = SensorCustomization.get("sensor_default_daterange") if not start: - if sensor_default_daterange == "last_week": + if sensor_default_daterange == "last_year": + start = now - timedelta(days=365) + elif sensor_default_daterange == "last_month": + start = now - timedelta(days=30) + elif sensor_default_daterange == "last_week": start = now - timedelta(weeks=1) elif sensor_default_daterange == "last_72hrs": start = now - timedelta(days=3)