diff --git a/temporal/t.unregister/t.unregister.py b/temporal/t.unregister/t.unregister.py index f10632af779..ec61dfb3129 100755 --- a/temporal/t.unregister/t.unregister.py +++ b/temporal/t.unregister/t.unregister.py @@ -50,7 +50,6 @@ import grass.script as grass - # lazy imports at the end of the file ############################################################################ @@ -77,6 +76,13 @@ def main(): dbif = tgis.SQLDatabaseInterfaceConnection() dbif.connect() + # modify a stds only if it is in the current mapset + # remove all connections to any other mapsets + # ugly hack ! + currcon = {} + currcon[mapset] = dbif.connections[mapset] + dbif.connections = currcon + # In case a space time dataset is specified if input: sp = tgis.open_old_stds(input, type, dbif) @@ -129,7 +135,7 @@ def main(): map = tgis.dataset_factory(type, mapid) # Unregister map if in database - if map.is_in_db(dbif): + if map.is_in_db(dbif, mapset=mapset): # Unregister from a single dataset if input: # Collect SQL statements