@NotLoggedInRequired
def setup(request):
    sans_facebook = True if request.GET.has_key('sans_facebook') and request.GET['sans_facebook'] else False
    redirect_to = request.GET.get('redirect_to', "/")

    form = CreateAccountForm(initial={'redirect_to': redirect_to,})
    if request.POST:
        sans_facebook = True if request.POST.has_key('sans_facebook') and request.POST['sans_facebook'] else False
        form = CreateAccountForm(request.POST)
        if form.is_valid():
            u = User()
            u.bio = form.cleaned_data['bio']
            u.birth_year = form.cleaned_data['birth_year']
            u.email = u.long_email = form.cleaned_data['email']
            u.fb_access_token = form.cleaned_data['fb_access_token']
            u.gender = form.cleaned_data['gender']
            u.first_name = form.cleaned_data['first_name']
            u.last_name = form.cleaned_data['last_name']
            u.facebook_id = form.cleaned_data['fbid']
            u.bio = u.bio.encode('utf-8') if u.bio else ""
            u.first_name = u.first_name.encode('utf-8') if u.first_name else ""
            u.last_name = u.last_name.encode('utf-8') if u.last_name else ""
            if form.cleaned_data['location_data']:
                u.location = Location.get_or_create(form.cleaned_data['location_data'])
            u.next_email_time = datetime.datetime.now() + timedelta(days = 1)
            u.username = create_handle((u.first_name, u.last_name) % '%s%s')
            u.password = hash_password(form.cleaned_data['password'])
            u.save()

            Subscription.get_or_create(user = u, pub_id = NOTIFICATIONS_PUB)

            #Post to Facebook
            if form.cleaned_data['post_to_facebook']:
                fb_helpers.post_joined_to_wall(u)

            cache.put_on_handle(u, u.username)

            redirect_to = form.cleaned_data['redirect_to'] or '/'
            #perform for all that login magic that happens under the covers
            attempt_login(request, u.username, form.cleaned_data["password"])
            return set_auth_cookies(HttpResponseRedirect(redirect_to), u)

    return render(request, 'user/setup.html', {
        'title' : 'Setup your account',
        'create_form' : form,
        'sans_facebook': sans_facebook,
        })
dataset/ETHPy150Open jumoconnect/openjumo/jumodjango/users/views.py/setup/swapped operands of `%`