@csrf_exempt
@staff_member_required
def manage_oneoffs(request):
    """
    Manage the hard-coded one-offs. Admins only.
    """

    if request.method == 'POST':
        if request.POST in 'action':
            try:
                action, version, term, target = (request.POST['action'],
                                                 request.POST['version'],
                                                 request.POST['term'],
                                                 request.POST['target'])
            except KeyError:
                return redirect(manage_oneoffs)
            if action == 'add':
                add_oneoff(version, term, target)
            elif action == 'kill':
                kill_oneoff(version, term)
        return redirect(manage_oneoffs)

    keys = r.keys('redirects:v2:oneoffs:*')
    targets = r.mget(keys) if keys else []

    oneoffs = []
    for (k, target) in zip(keys, targets):
        k = k.replace('redirects:v2:oneoffs:', '')
        if ':' in k:
            version, term = k.split(':')
        else:
            version, term = None, k
        oneoffs.append((version, term, target))

    return render(request, 'oneoffs.html', {
        'oneoffs': oneoffs,
    })
dataset/ETHPy150Open djangome/djangome/djangome/views.py/manage_oneoffs/swapped operands of `in`