Fix formatting

This commit is contained in:
R. Miles McCain 2021-01-23 23:16:33 -05:00
parent db9c807289
commit 89c6800913
No known key found for this signature in database
GPG Key ID: F1053629E2905557
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()}"
)

View File

@ -53,11 +53,13 @@ class ServiceForm(forms.ModelForm):
}
collect_ips = forms.BooleanField(
help_text="IP address collection is disabled globally by your administrator." if settings.BLOCK_ALL_IPS else "Should individual IP addresses be collected? IP metadata (location, host, etc) will still be collected.",
help_text="IP address collection is disabled globally by your administrator."
if settings.BLOCK_ALL_IPS
else "Should individual IP addresses be collected? IP metadata (location, host, etc) will still be collected.",
widget=forms.RadioSelect(choices=[(True, "Yes"), (False, "No")]),
initial=False if settings.BLOCK_ALL_IPS else True,
required=False,
disabled=settings.BLOCK_ALL_IPS
disabled=settings.BLOCK_ALL_IPS,
)
def clean_collect_ips(self):