fixes to make mypy happy

Adrian Maraj 2024-04-16 09:24:50 +02:00
parent 0823df68ca
commit 8bbf2bf288
2 changed files with 5 additions and 4 deletions

View File

@ -18,6 +18,7 @@ from lookyloo.default import AbstractManager, get_config
from lookyloo.helpers import get_captures_dir from lookyloo.helpers import get_captures_dir
from lookyloo.modules import FOX from lookyloo.modules import FOX
from website.web import modules
logging.config.dictConfig(get_config('logging')) logging.config.dictConfig(get_config('logging'))
@ -112,8 +113,8 @@ class AsyncCapture(AbstractManager):
settings = json.loads(to_capture['auto_report']) settings = json.loads(to_capture['auto_report'])
elif isinstance(to_capture['auto_report'], dict): elif isinstance(to_capture['auto_report'], dict):
settings = to_capture['auto_report'] settings = to_capture['auto_report']
response_3rd_party = modules(uuid, True)
self.lookyloo.send_mail(uuid, email=settings.get('email', ''), self.lookyloo.send_mail(uuid,response_3rd_party, email=settings.get('email', ''),
comment=settings.get('comment')) comment=settings.get('comment'))
lazy_cleanup = self.lookyloo.redis.pipeline() lazy_cleanup = self.lookyloo.redis.pipeline()

View File

@ -901,11 +901,11 @@ def modules(tree_uuid: str, mail: bool = False) -> str | WerkzeugResponse | Resp
if short_results[module]: # some might have more values which have to be checked if they are empty if short_results[module]: # some might have more values which have to be checked if they are empty
for data in short_results[module]: for data in short_results[module]:
if short_results[module][data]: # if true we can consider that there is a hit and the capture might be malicious if short_results[module][data]: # if true we can consider that there is a hit and the capture might be malicious
return ("**************************************************\n" return str("**************************************************\n"
" Malicious capture according to 3rd party modules \n" " Malicious capture according to 3rd party modules \n"
"**************************************************") "**************************************************")
return ('********************************************\n' return str('********************************************\n'
' Capture doesn\'t seem to be malicious\n' ' Capture doesn\'t seem to be malicious\n'
'********************************************') '********************************************')