diff --git a/Dockerfile b/Dockerfile index 7be8c9c..e657319 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,9 +11,12 @@ RUN apk add --no-cache \ WORKDIR /install # install private repo +# Pinned by CI to the commit image-plan.py hashed into this image's content +# key. Defaults to dev so a hand build still works. +ARG COMMON_UTILS_REF=dev RUN --mount=type=secret,id=github_token \ pip install --no-cache-dir --prefix=/install \ - git+https://$(cat /run/secrets/github_token)@github.com/Space-DF/django-common-utils.git@dev + git+https://$(cat /run/secrets/github_token)@github.com/Space-DF/django-common-utils.git@${COMMON_UTILS_REF} # install python requirements COPY requirements.txt . diff --git a/apps/device/serializers.py b/apps/device/serializers.py index 8c82a28..b17deed 100644 --- a/apps/device/serializers.py +++ b/apps/device/serializers.py @@ -107,6 +107,7 @@ def create(self, validated_data): class LocationSerializer(serializers.Serializer): latitude = serializers.FloatField() longitude = serializers.FloatField() + bearing = serializers.FloatField(required=False, allow_null=True) class FormatDeviceSerializer(serializers.ModelSerializer): diff --git a/apps/device/tasks.py b/apps/device/tasks.py index 1cbb0a1..d49b18c 100644 --- a/apps/device/tasks.py +++ b/apps/device/tasks.py @@ -145,7 +145,9 @@ def device_upgrade_task(**kwargs): @tenant_shared_task(name="spacedf.tasks.update_device_location") -def update_device_location(device_id: str, latitude: float, longitude: float): +def update_device_location( + device_id: str, latitude: float, longitude: float, bearing: float +): try: device = Device.objects.get(id=device_id) except Device.DoesNotExist: @@ -157,5 +159,6 @@ def update_device_location(device_id: str, latitude: float, longitude: float): device.location = { "latitude": latitude, "longitude": longitude, + "bearing": bearing, } device.save(update_fields=["location", "updated_at"]) diff --git a/requirements.txt b/requirements.txt index cfba00d..1312064 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,24 +1,24 @@ # Core -Django==5.0.6 +Django==5.2.16 django-environ==0.11.2 gunicorn==22.0.0 gevent==24.2.1 -django_tenants==3.6.1 +django_tenants==3.10.2 celery==5.4.0 -cryptography==42.0.8 -python-dotenv==1.0.1 +cryptography==50.0.0 +python-dotenv==1.2.2 # For the persistence stores psycopg2-binary==2.9.9 # Rest apis djangorestframework==3.15.2 -djangorestframework_simplejwt==5.3.1 +djangorestframework_simplejwt==5.5.1 django-cors-headers==4.4.0 drf-yasg==1.21.7 whitenoise==6.7.0 django-filter==24.2 -requests==2.31.0 +requests==2.33.0 django-redis==5.4.0 boto3==1.37.13 django-silk==5.3.2