mirror of https://github.com/CIRCL/lookyloo
fix: Make mypy happy
parent
a1bbffd4ad
commit
8c62a597e7
|
@ -58,7 +58,7 @@ class MISP():
|
||||||
def get_fav_tags(self):
|
def get_fav_tags(self):
|
||||||
return self.client.tags(pythonify=True, favouritesOnly=1)
|
return self.client.tags(pythonify=True, favouritesOnly=1)
|
||||||
|
|
||||||
def _prepare_push(self, to_push: Union[List[MISPEvent], MISPEvent], allow_duplicates: bool=False, auto_publish: bool=False) -> Union[List[MISPEvent], Dict]:
|
def _prepare_push(self, to_push: Union[List[MISPEvent], MISPEvent], allow_duplicates: bool=False, auto_publish: Optional[bool]=False) -> Union[List[MISPEvent], Dict]:
|
||||||
'''Adds the pre-configured information as required by the instance.
|
'''Adds the pre-configured information as required by the instance.
|
||||||
If duplicates aren't allowed, they will be automatically skiped and the
|
If duplicates aren't allowed, they will be automatically skiped and the
|
||||||
extends_uuid key in the next element in the list updated'''
|
extends_uuid key in the next element in the list updated'''
|
||||||
|
@ -128,9 +128,11 @@ class MISP():
|
||||||
to_lookup += hostnode.cnames
|
to_lookup += hostnode.cnames
|
||||||
if attributes := self.client.search(controller='attributes', value=to_lookup, pythonify=True):
|
if attributes := self.client.search(controller='attributes', value=to_lookup, pythonify=True):
|
||||||
if isinstance(attributes, list):
|
if isinstance(attributes, list):
|
||||||
return list(set(attribute.event_id for attribute in attributes))
|
# NOTE: We have MISPAttributes in that list
|
||||||
|
return list(set(attribute.event_id for attribute in attributes)) # type: ignore
|
||||||
else:
|
else:
|
||||||
return attributes
|
# The request returned an error
|
||||||
|
return attributes # type: ignore
|
||||||
return []
|
return []
|
||||||
else:
|
else:
|
||||||
return {'error': 'Module not available or lookup not enabled.'}
|
return {'error': 'Module not available or lookup not enabled.'}
|
||||||
|
|
|
@ -345,7 +345,7 @@ def web_misp_lookup_view(tree_uuid: str):
|
||||||
if hits:
|
if hits:
|
||||||
misp_root_url = lookyloo.misp.client.root_url
|
misp_root_url = lookyloo.misp.client.root_url
|
||||||
else:
|
else:
|
||||||
misp_root_url = None
|
misp_root_url = ''
|
||||||
return render_template('misp_lookup.html', uuid=tree_uuid, hits=hits, misp_root_url=misp_root_url)
|
return render_template('misp_lookup.html', uuid=tree_uuid, hits=hits, misp_root_url=misp_root_url)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue