Prevented a console warning if asl-rulebook2 has not been configured.

master
Pacman Ghost 3 years ago
parent 4d15050d72
commit 85a0085a8a
  1. 3
      vasl_templates/webapp/static/main.js
  2. 3
      vasl_templates/webapp/vo_notes.py

@ -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:<div class='pre'>" + escapeHTML(errorMsg) + "</div>" ) ;
showErrorMsg( "Can't get the ASL Rulebook2 vehicle/ordnance note targets:<div class='pre'>" + escapeHTML(errorMsg) + "</div>" ) ;
update_page_load_status( "asl-rulebook2-vo-note-targets" ) ;
} ) ;

@ -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/<path:target>" )

Loading…
Cancel
Save