Exemplo n.º 1
0
def tos_acceptance(request):
    if request.method == 'POST':
        form = TermsOfServiceForm(request.POST)
        if form.is_valid():
            Profile.objects.filter(user=request.user).update(accepted_tos=True)
            cache.set('has-accepted-tos-%s' % request.user.id, 'yes', 2592000)
            return HttpResponseRedirect(reverse('accounts-home'))
    else:
        form = TermsOfServiceForm()
    tvars = {'form': form}
    return render(request, 'accounts/accept_terms_of_service.html', tvars)
Exemplo n.º 2
0
def tos_acceptance(request):
    if request.method == "POST":
        form = TermsOfServiceForm(request.POST)
        if form.is_valid():
            Profile.objects.filter(user=request.user).update(accepted_tos=True)
            cache.set("has-accepted-tos-%s" % request.user.id, "yes", 2592000)
            return HttpResponseRedirect(reverse("accounts-home"))
    else:
        form = TermsOfServiceForm()
    tvars = {"form": form}
    return render(request, "accounts/accept_terms_of_service.html", tvars)
Exemplo n.º 3
0
def tos_acceptance(request):
    if request.method == 'POST':
        form = TermsOfServiceForm(request.POST)
        if form.is_valid():
            # update accepted tos field in user profile
            Profile.objects.filter(user=request.user).update(accepted_tos=True)
            # update cache
            cache.set("has-accepted-tos-%s" % request.user.id, 'yes', 2592000)
            return HttpResponseRedirect(reverse('accounts-home'))
    else:
        form = TermsOfServiceForm()
    return render_to_response('accounts/accept_terms_of_service.html', locals(), context_instance=RequestContext(request))