Skip to content

Commit

Permalink
#51 modifying the manager of nansat ingester
Browse files Browse the repository at this point in the history
  • Loading branch information
aanersc committed Sep 25, 2020
1 parent 8e60bd7 commit 36a0317
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions geospaas/nansat_ingestor/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from django.db import models

from geospaas.catalog.managers import FILE_SERVICE_NAME, LOCAL_FILE_SERVICE
from geospaas.catalog.models import (Dataset, DatasetParameter, DatasetURI,
from geospaas.catalog.models import (Dataset, DatasetURI,
GeographicLocation, Source)
from geospaas.utils.utils import nansat_filename, validate_uri
from geospaas.vocabularies.models import (DataCenter, Instrument,
Expand Down Expand Up @@ -132,7 +132,7 @@ def get_or_create(self,
geometry=WKTReader().read(n.get_border_wkt(nPoints=n_points)))[0]

# create dataset
# - the get_or_create method should use get_or_create here as well,
# - the get_or_create method should use get_or_create here as well,
# or its name should be changed - see issue #127
ds, created = Dataset.objects.update_or_create(entry_id=options['entry_id'], defaults={
'time_coverage_start': n.get_metadata('time_coverage_start'),
Expand Down Expand Up @@ -161,8 +161,6 @@ def get_or_create(self,
if params.count() > 1 and units is not None:
params = params.filter(units=units)
if params.count() >= 1:
DatasetParameter.objects.get_or_create(
dataset=ds, parameter=params[0])
ds.parameters.add(params[0])

# create dataset URI
Expand Down

0 comments on commit 36a0317

Please sign in to comment.