Example #1
0
def reset_overlays(request):
    if request.method == 'POST':
        Overlay.objects.filter(user=request.user).delete()
        return redirect(get_next(request))

    return render(request, 'overlays/reset_overlays.html',
                  {'next': get_referer_path_info(request, default='/')})
Example #2
0
def profile_update(request):
    if settings.PROFILE_UPDATE:
        form = ProfileForm(request.POST or None, instance=request.user)

        if request.method == 'POST':
            if 'cancel' in request.POST:
                return HttpResponseRedirect(get_next(request))

            if form.is_valid():
                form.save()
                return HttpResponseRedirect(get_next(request))

        return render(request, 'profile/profile_update_form.html', {
            'form': form,
            'next': get_referer_path_info(request, default='/')
        })
    else:
        return render(request, 'profile/profile_update_closed.html')