Skip to content

Commit

Permalink
Removed events from annotator post
Browse files Browse the repository at this point in the history
  • Loading branch information
jsbroks committed Apr 4, 2019
1 parent 341aeba commit e2fe385
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions backend/webserver/api/annotator.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ class AnnotatorId(Resource):
@login_required
def get(self, image_id):
""" Called when loading from the annotator client """
image = ImageModel.objects(id=image_id).first()
image = ImageModel.objects(id=image_id)\
.exclude('events').first()

if image is None:
return {'success': False, 'message': 'Could not load image'}, 400
Expand All @@ -146,8 +147,8 @@ def get(self, image_id):
if dataset is None:
return {'success': False, 'message': 'Could not find associated dataset'}, 400

categories = CategoryModel.objects(deleted=False).in_bulk(dataset.categories).items()

categories = CategoryModel.objects(deleted=False)\
.in_bulk(dataset.categories).items()

# Get next and previous image
images = ImageModel.objects(dataset_id=dataset.id, deleted=False)
Expand Down Expand Up @@ -177,7 +178,8 @@ def get(self, image_id):
category = query_util.fix_ids(category[1])

category_id = category.get('id')
annotations = AnnotationModel.objects(image_id=image_id, category_id=category_id, deleted=False).all()
annotations = AnnotationModel.objects(image_id=image_id, category_id=category_id, deleted=False)\
.exclude('events').all()

category['show'] = True
category['visualize'] = False
Expand Down

0 comments on commit e2fe385

Please sign in to comment.