mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-22 03:13:12 +00:00
Fix searching for malformated IP or MAC addresses in machine history search
This commit is contained in:
parent
364f89d3d4
commit
a659e2fcbd
1 changed files with 3 additions and 2 deletions
|
@ -27,6 +27,7 @@ from django.contrib.auth.models import Group
|
|||
from django.db.models import Q
|
||||
from django.apps import apps
|
||||
from netaddr import EUI
|
||||
macaddress.fields import default_dialect
|
||||
|
||||
from machines.models import IpList
|
||||
from machines.models import Interface
|
||||
|
@ -156,12 +157,12 @@ class MachineHistorySearch:
|
|||
pass
|
||||
elif search_type == "mac":
|
||||
try:
|
||||
search = EUI(search)
|
||||
search = EUI(search, dialect=default_dialect())
|
||||
return self._get_by_mac(search)[::-1]
|
||||
except:
|
||||
pass
|
||||
|
||||
return None
|
||||
return []
|
||||
|
||||
def _add_revision(self, user, machine, interface):
|
||||
"""
|
||||
|
|
Loading…
Reference in a new issue