Skip to content

Commit

Permalink
Flake 8
Browse files Browse the repository at this point in the history
  • Loading branch information
U039b committed Sep 22, 2024
1 parent 8df5fc5 commit 0792087
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
1 change: 0 additions & 1 deletion threatr/core/api/generic.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import datetime
from datetime import timedelta, datetime

import pytz
Expand Down
1 change: 0 additions & 1 deletion threatr/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ def merge_events(event_list: list[Event]):
if not merged or event.first_seen.date() > merged[-1].last_seen.date():
merged.append(event)
else:
# If the current interval overlaps with the previous one, merge them by updating the end value of the last interval
merged[-1].last_seen = max(merged[-1].last_seen, event.last_seen)
merged[-1].count += event.count
dropped.append(event)
Expand Down
8 changes: 4 additions & 4 deletions threatr/modules/scarletshark_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,12 @@ def execute_request(self) -> dict:
return self.vendor_response

def __process_threat_actor(self, actor_id):
if actor_id < 1: return None
if actor_id < 1: return None # noqa: E701
result = self.client.search_threat_actors(threat_actor_id=actor_id)
print(result)
if not result: return None
if not result: return None # noqa: E701
aliases = result.get('aliases', [])
if not aliases: return None
if not aliases: return None # noqa: E701
name = aliases.pop(0).get('alias_name')
description = result.get('description', '')
actor, _ = Entity.objects.update_or_create(
Expand All @@ -104,7 +104,7 @@ def __process_threat_actor(self, actor_id):
actor.save()
for alias in aliases:
alias_name = alias.get('alias_name', '')
if not alias_name: continue
if not alias_name: continue # noqa: E701
a, _ = Entity.objects.update_or_create(
name=alias_name.strip(),
super_type=EntitySuperType.get_types().get("ACTOR"),
Expand Down

0 comments on commit 0792087

Please sign in to comment.