Fix formatting

This commit is contained in:
R. Miles McCain
2021-01-23 23:16:33 -05:00
parent db9c807289
commit 89c6800913
5 changed files with 12 additions and 6 deletions

View File

@@ -58,7 +58,9 @@ class Session(models.Model):
@property
def is_currently_active(self):
return timezone.now() - self.last_seen < timezone.timedelta(milliseconds=settings.SCRIPT_HEARTBEAT_FREQUENCY * 2)
return timezone.now() - self.last_seen < timezone.timedelta(
milliseconds=settings.SCRIPT_HEARTBEAT_FREQUENCY * 2
)
@property
def duration(self):

View File

@@ -80,7 +80,9 @@ def ingress_request(
association_id_hash.update(str(user_agent).encode("utf-8"))
if settings.AGGRESSIVE_HASH_SALTING:
association_id_hash.update(str(service.pk).encode("utf-8"))
association_id_hash.update(str(timezone.now().date().isoformat()).encode("utf-8"))
association_id_hash.update(
str(timezone.now().date().isoformat()).encode("utf-8")
)
session_cache_path = (
f"session_association_{service.pk}_{association_id_hash.hexdigest()}"
)