Skip to content

Commit

Permalink
Made changes to allow god labelers to be served maxed out labels.
Browse files Browse the repository at this point in the history
  • Loading branch information
dcunhas committed Aug 25, 2016
1 parent b2b0b38 commit 112f244
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions webclient/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,19 +243,22 @@ def getNewImage(request):
crop_images.NUM_WINDOW_ROWS * crop_images.NUM_LABELS_PER_WINDOW


images = img.annotate(count=Count('imagelabel')) \
.filter(count__lt=labelsPerImage).order_by('count').reverse()
images = img.annotate(count=Count('imagelabel'))
user = request.user
if user.groups.filter(name='god').exists():
ignore_max_count = True
else:
ignore_max_count = False
images = images.filter(count__lt=labelsPerImage)

images = images.order_by('count').reverse()




subimage = None

user = request.user
if user.groups.filter(name='god').exists():
ignore_max_count = True
else:
ignore_max_count = False


for i in images:
subimage = crop_images.getImageWindow(i, request.user, ignore_max_count=ignore_max_count)
Expand Down

0 comments on commit 112f244

Please sign in to comment.