Fix formatting
This commit is contained in:
parent
db9c807289
commit
89c6800913
@ -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):
|
||||
|
@ -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()}"
|
||||
)
|
||||
|
@ -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):
|
||||
|
@ -100,7 +100,7 @@ def compare(
|
||||
):
|
||||
if isinstance(start, timedelta):
|
||||
start = start.seconds
|
||||
|
||||
|
||||
if isinstance(end, timedelta):
|
||||
end = end.seconds
|
||||
|
||||
|
@ -326,4 +326,4 @@ SHOW_THIRD_PARTY_ICONS = os.getenv("SHOW_THIRD_PARTY_ICONS", "True") == "True"
|
||||
BLOCK_ALL_IPS = os.getenv("BLOCK_ALL_IPS", "False") == "True"
|
||||
|
||||
# Include date and service ID in salt?
|
||||
AGGRESSIVE_HASH_SALTING = os.getenv("AGGRESSIVE_HASH_SALTING", "False") == True
|
||||
AGGRESSIVE_HASH_SALTING = os.getenv("AGGRESSIVE_HASH_SALTING", "False") == True
|
||||
|
Loading…
Reference in New Issue
Block a user