def delete_hit(request, hid): mturk_permission = check_mturk_access(request) if mturk_permission == True: hit = get_hit(hid,request) if check_battery_edit_permission(request,hit.battery): hit.expire() hit.delete() return redirect(hit.battery.get_absolute_url()) else: return HttpResponseForbidden()
def delete_hit(request, hid): mturk_permission = check_mturk_access(request) if mturk_permission == True: hit = get_hit(hid,request) if check_battery_edit_permission(request,hit.battery): # A hit deleted in Amazon cannot be expired try: hit.expire() hit.dispose() except: pass hit.delete() return redirect(hit.battery.get_absolute_url()) else: return HttpResponseForbidden()
def expire_hit(request, hid): mturk_permission = check_mturk_access(request) if mturk_permission == True: hit = get_hit(hid,request) battery = hit.battery if check_battery_edit_permission(request,hit.battery): # Remove expired/deleted hits from interface try: hit.expire() except: hit.delete() return redirect(battery.get_absolute_url()) else: return HttpResponseForbidden()