Fix strmmsi_to_mmsi import
authorJean-Michel Nirgal Vourgère <jmv@nirgal.com>
Wed, 18 May 2011 16:47:35 +0000 (16:47 +0000)
committerJean-Michel Nirgal Vourgère <jmv@nirgal.com>
Wed, 18 May 2011 16:47:35 +0000 (16:47 +0000)
Allow some user to see hidden ships in archives

bin/djais/views.py
bin/show_targets_ships.py

index 43e532c760a1c4b8b2447d724100d553036e26fd..4c8307c73954336efd92d50f3b35ef21b2dad2cb 100644 (file)
@@ -630,6 +630,8 @@ def vessel_history(request, strmmsi):
         if form.is_valid():
             command, extension = form.get_cmdext()
 
+            if request.user.flag_allowhidden:
+                command += u' --show-hidden-ships'
             command += u' ' + strmmsi
 
             job = Job()
@@ -858,6 +860,8 @@ def fleet_history(request, fleetname):
         if form.is_valid():
             command, extension = form.get_cmdext()
 
+            if request.user.flag_allowhidden:
+                command += u' --show-hidden-ships'
             command += u' @' + fleetname
 
             job = Job()
index 15c790f6b769b17645a2c57663d34da7ebc63722..f79772d4df0b5c034487d0540ce0c7ef2a912226 100755 (executable)
@@ -9,6 +9,7 @@ from StringIO import StringIO # TODO use python 2.6 io.BufferedWrite(sys.stdout,
 from datetime import datetime, timedelta, time
 import copy
 
+from ais.ntools import strmmsi_to_mmsi, mmsi_to_strmmsi
 from ais.common import *
 from ais.area import load_area_from_kml_polygon
 from ais.ntools import datetime_to_timestamp, xml_escape, LatLonFormatError, clean_latitude, clean_longitude