Skip to content

Commit

Permalink
Merge branch 'devel'
Browse files Browse the repository at this point in the history
  • Loading branch information
dcunhas committed Aug 28, 2016
2 parents da0fe26 + abc17bc commit 72e0e53
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions webclient/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,15 +243,16 @@ def getNewImage(request):
crop_images.NUM_WINDOW_ROWS * crop_images.NUM_LABELS_PER_WINDOW


images = img.annotate(count=Count('imagelabel'))
images = img.annotate(count=Count('imagelabel')).filter(count__lt=labelsPerImage)
user = request.user
if user.groups.filter(name='god').exists():
ignore_max_count = True
else:
ignore_max_count = False
categories_to_label = ['nighttime_apple', 'orange']
all_unfinished_images = images
for cat in categories_to_label:
images = images.filter(count__lt=labelsPerImage).filter(categoryType__category_name=cat)
images = all_unfinished_images.filter(categoryType__category_name=cat)
if images:
break

Expand Down

0 comments on commit 72e0e53

Please sign in to comment.