Skip to content
Merged

Dev #151

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 .
Expand Down
1 change: 1 addition & 0 deletions apps/device/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
5 changes: 4 additions & 1 deletion apps/device/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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"])
12 changes: 6 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading