コード例 #1
0
ファイル: views.py プロジェクト: jkredz/expfactory-docker
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()
コード例 #2
0
ファイル: views.py プロジェクト: rwblair/expfactory-docker
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()
コード例 #3
0
ファイル: views.py プロジェクト: rwblair/expfactory-docker
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()