Commit 72f44fdc authored by marius's avatar marius
Browse files

Raising non-unique scene_ids

parent 05c6fd34
......@@ -236,7 +236,12 @@ class Dataset(object):
scene._log.setLevel(logger.level)
scene.load(filename)
self.kite_scenes.append(scene)
try:
self.get_kite_scene(scene.meta.scene_id)
except NotFound:
self.kite_scenes.append(scene)
else:
raise AttributeError('scene_id not unique for %s' % filename)
def is_blacklisted(self, obj):
try:
......@@ -341,7 +346,7 @@ class Dataset(object):
for scene in self.kite_scenes:
if scene.meta.scene_id is scene_id:
return scene
raise AttributeError('No kite scene with id %s defined' % scene_id)
raise NotFound('No kite scene with id %s defined' % scene_id)
def get_response(self, obj):
if (self.responses is None or len(self.responses) == 0) \
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment