From 85a0085a8a4c97c17c0c33da543052e293a468ce Mon Sep 17 00:00:00 2001 From: Taka Date: Tue, 22 Jun 2021 06:51:41 +1000 Subject: [PATCH] Prevented a console warning if asl-rulebook2 has not been configured. --- vasl_templates/webapp/static/main.js | 3 +-- vasl_templates/webapp/vo_notes.py | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/vasl_templates/webapp/static/main.js b/vasl_templates/webapp/static/main.js index d09cf33..f477596 100644 --- a/vasl_templates/webapp/static/main.js +++ b/vasl_templates/webapp/static/main.js @@ -353,8 +353,7 @@ $(document).ready( function () { gAslRulebook2VoNoteTargets = data ; update_page_load_status( "asl-rulebook2-vo-note-targets" ) ; } ).fail( function( xhr, status, errorMsg ) { - if ( xhr.status != 404 ) - showErrorMsg( "Can't get the ASL Rulebook2 vehicle/ordnance note targets:
" + escapeHTML(errorMsg) + "
" ) ; + showErrorMsg( "Can't get the ASL Rulebook2 vehicle/ordnance note targets:
" + escapeHTML(errorMsg) + "
" ) ; update_page_load_status( "asl-rulebook2-vo-note-targets" ) ; } ) ; diff --git a/vasl_templates/webapp/vo_notes.py b/vasl_templates/webapp/vo_notes.py index 9ef1d71..0e50005 100644 --- a/vasl_templates/webapp/vo_notes.py +++ b/vasl_templates/webapp/vo_notes.py @@ -363,7 +363,8 @@ def get_vo_notes_report( nat, vo_type ): def get_asl_rulebook2_vo_note_targets(): """Return the Chapter H vehicle/ordnance note targets.""" if not _asl_rulebook2_targets: - abort( 404 ) + # FUDGE! We should really 404 here, but this causes a warning to appear in the browser console :-/ + return jsonify( {} ) return jsonify( _asl_rulebook2_targets ) @app.route( "/asl-rulebook2/" )