@handle_response_format
@treeio_login_required
def settings_edit(request, response_format='html'):
    "Settings admin view"

    if request.POST:
        if request.POST not in 'cancel':
            form = SettingsForm(request.user.profile, request.POST)
            if form.is_valid():
                form.save()
                return HttpResponseRedirect(reverse('messaging_settings_view'))
        else:
            return HttpResponseRedirect(reverse('messaging_settings_view'))
    else:
        form = SettingsForm(request.user.profile)

    context = _get_default_context(request)
    context.update({'form': form})

    return render_to_response('messaging/settings_edit', context,
                              context_instance=RequestContext(request),
                              response_format=response_format)


#
# Widgets
#
dataset/ETHPy150Open treeio/treeio/treeio/messaging/views.py/settings_edit/swapped operands of `not in`