From 793f7b6c77c031f30f1e0a1664ef1305f709b6b7 Mon Sep 17 00:00:00 2001 From: Pauliina Ilmanen Date: Tue, 11 Mar 2025 10:02:17 +0200 Subject: [PATCH] Change Securitas grant installation time Instead of installing the Securitas grant 24h hours before the start time, the grant can be given right after the reservation is confirmed. Refs TTVA-239 --- kulkunen/drivers/securitas.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/kulkunen/drivers/securitas.py b/kulkunen/drivers/securitas.py index 7c4e33ccb..bb37df3a1 100644 --- a/kulkunen/drivers/securitas.py +++ b/kulkunen/drivers/securitas.py @@ -1,6 +1,5 @@ import jsonschema import requests -from datetime import timedelta from django.core.exceptions import ValidationError from django.utils import timezone from jsonschema.exceptions import ValidationError as JsonSchemaValidationError @@ -119,11 +118,8 @@ def remove_grant(self, grant): ) def prepare_install_grant(self, grant): - # Because of a bug in SiPass API, the changes are not synchronized - # to the building units automatically. We install the grants one day - # before their start time and schedule a re-install of the units - # every nightly. - grant.install_at = grant.starts_at - timedelta(days=1) + # Securitas grants can be installed immediately + grant.install_at = timezone.now() grant.save(update_fields=["install_at"]) def get_system_config_schema(self):