Skip to content
This repository has been archived by the owner on Sep 16, 2022. It is now read-only.

Commit

Permalink
Remove useless code in FirewallState and get_trust_score.
Browse files Browse the repository at this point in the history
  • Loading branch information
a-martynovich committed Apr 3, 2020
1 parent c212d33 commit 87ed8a3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
6 changes: 0 additions & 6 deletions backend/device_registry/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -786,12 +786,6 @@ def connections_form_data(self):


class FirewallState(models.Model):
POLICY_ENABLED_ALLOW = 1
POLICY_ENABLED_BLOCK = 2
POLICY_CHOICES = (
(POLICY_ENABLED_ALLOW, 'Allow by default'),
(POLICY_ENABLED_BLOCK, 'Block by default')
)
device = models.OneToOneField(Device, on_delete=models.CASCADE)
scan_date = models.DateTimeField(null=True, auto_now_add=True)
rules = JSONField(blank=True, default=dict)
Expand Down
2 changes: 1 addition & 1 deletion backend/device_registry/recommended_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ def _affected_devices(cls, qs):

@classmethod
def _is_affected(cls, device) -> bool:
from .models import FirewallState, GlobalPolicy
from .models import GlobalPolicy
firewallstate = getattr(device, 'firewallstate', None)
return firewallstate is not None \
and (firewallstate.global_policy is None
Expand Down

0 comments on commit 87ed8a3

Please sign in to comment.