Skip to content

Commit 73df522

Browse files
testing prod issue
1 parent 0d8ecbb commit 73df522

File tree

2 files changed

+24
-12
lines changed

2 files changed

+24
-12
lines changed

app/api/tasks.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,8 @@ def create_scan_bg(self, *args, **kwargs) -> None:
376376
try:
377377
pages.append(
378378
Page.objects.get(id=item['id'])
379-
)
379+
)
380+
print(f'pages added -> {pages}')
380381
except Exception as e:
381382
print(e)
382383

@@ -386,6 +387,7 @@ def create_scan_bg(self, *args, **kwargs) -> None:
386387
sites.append(
387388
Site.objects.get(id=item['id'])
388389
)
390+
print(f'sites added -> {sites}')
389391
except Exception as e:
390392
print(e)
391393

@@ -400,9 +402,12 @@ def create_scan_bg(self, *args, **kwargs) -> None:
400402

401403
# creating scans for each page
402404
for page in pages:
405+
print(f'trying to scan page -> {page.page_url}')
403406
# check resource
404407
if check_and_increment_resource(page.account, 'scans'):
405408

409+
print(f'allowed to create new Scan')
410+
406411
# updating latest_scan info for page
407412
page.info['latest_scan']['id'] = 'placeholder'
408413
page.info['latest_scan']['time_created'] = str(timezone.now())
@@ -411,19 +416,26 @@ def create_scan_bg(self, *args, **kwargs) -> None:
411416
page.info['latest_scan']['score'] = None
412417
page.save()
413418

419+
print('updated page info')
420+
414421
# updating latest_scan info for site
415422
page.site.info['latest_scan']['id'] = 'placeholder'
416423
page.site.info['latest_scan']['time_created'] = str(timezone.now())
417424
page.site.info['latest_scan']['time_completed'] = None
418425
page.site.save()
419426

427+
print('updated site info')
428+
429+
420430
create_scan.delay(
421431
page_id=page.id,
422432
type=type,
423433
configs=configs,
424434
tags=tags,
425435
automation_id=automation_id
426436
)
437+
438+
print('init new bg scan')
427439

428440
# update schedule if task_id is not None
429441
if task_id:

app/api/utils/alerts.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ def create_exp(item: object=None, automation: object=None) -> dict:
226226
float(item.yellowlab_delta["scores"]["current_average"])) /2
227227
)
228228
elif 'health' in e['data_type']:
229-
title = 'Health:'
229+
title = 'Health'
230230
data = str(
231231
(float(item.lighthouse["scores"]["average"]) +
232232
float(item.yellowlab["scores"]["globalScore"])) /2
@@ -289,10 +289,10 @@ def create_exp(item: object=None, automation: object=None) -> dict:
289289
title = 'Images Delta'
290290
data = str(item.yellowlab_delta["scores"]["images_delta"])
291291
elif 'domComplexity_delta' in e['data_type']:
292-
title = 'DOM Complex. Delta'
292+
title = 'DOM Complexity Delta'
293293
data = str(item.yellowlab_delta["scores"]["domComplexity_delta"])
294294
elif 'javascriptComplexity_delta' in e['data_type']:
295-
title = 'JS Complex. Delta'
295+
title = 'JS Complexity Delta'
296296
data = str(item.yellowlab_delta["scores"]["javascriptComplexity_delta"])
297297
elif 'badJavascript_delta' in e['data_type']:
298298
title = 'Bad JS Delta'
@@ -301,7 +301,7 @@ def create_exp(item: object=None, automation: object=None) -> dict:
301301
title = 'jQuery Delta'
302302
data = str(item.yellowlab_delta["scores"]["jQuery_delta"])
303303
elif 'cssComplexity_delta' in e['data_type']:
304-
title = 'CSS Complex. Delta'
304+
title = 'CSS Complexity Delta'
305305
data = str(item.yellowlab_delta["scores"]["cssComplexity_delta"])
306306
elif 'badCSS_delta' in e['data_type']:
307307
title = 'Bad CSS Delta'
@@ -310,7 +310,7 @@ def create_exp(item: object=None, automation: object=None) -> dict:
310310
title = 'Fonts Delta'
311311
data = str(item.yellowlab_delta["scores"]["fonts_delta"])
312312
elif 'serverConfig_delta' in e['data_type']:
313-
title = 'Server Config Delta'
313+
title = 'Server Configs Delta'
314314
data = str(item.yellowlab_delta["scores"]["serverConfig_delta"])
315315

316316
# yellowlab scan data
@@ -324,28 +324,28 @@ def create_exp(item: object=None, automation: object=None) -> dict:
324324
title = 'Images'
325325
data = str(item.yellowlab["scores"]["images"])
326326
elif 'domComplexity' in e['data_type']:
327-
title = 'DOM Complex.'
327+
title = 'DOM Complexity'
328328
data = str(item.yellowlab["scores"]["domComplexity"])
329329
elif 'javascriptComplexity' in e['data_type']:
330-
title = 'JS Complex.'
330+
title = 'JS Complexity'
331331
data = str(item.yellowlab["scores"]["javascriptComplexity"])
332332
elif 'badJavascript' in e['data_type']:
333-
title = 'Bad JS.'
333+
title = 'Bad JS'
334334
data = str(item.yellowlab["scores"]["badJavascript"])
335335
elif 'jQuery' in e['data_type']:
336336
title = 'jQuery'
337337
data = str(item.yellowlab["scores"]["jQuery"])
338338
elif 'cssComplexity' in e['data_type']:
339-
title = 'CSS Complex'
339+
title = 'CSS Complexity'
340340
data = str(item.yellowlab["scores"]["cssComplexity"])
341341
elif 'badCSS' in e['data_type']:
342-
title = 'Bad CSS.'
342+
title = 'Bad CSS'
343343
data = str(item.yellowlab["scores"]["badCSS"])
344344
elif 'fonts' in e['data_type']:
345345
title = 'Fonts'
346346
data = str(item.yellowlab["scores"]["fonts"])
347347
elif 'serverConfig' in e['data_type']:
348-
title = 'Server Config.'
348+
title = 'Server Configs'
349349
data = str(item.yellowlab["scores"]["serverConfig"])
350350

351351
# image data

0 commit comments

Comments
 (0)