Пример #1
0
def resign(request):
    if request.method == "POST":
        form = LeadResignForm(request, data=request.POST)

        if form.is_valid():
            form.save()
            return json.success({})

        return json.error(form.errors)
    return HttpResponseNotAllowed(["POST"])
Пример #2
0
def settings_resign(request):
    if request.method == "POST":
        resign_form = LeadResignForm(request, data=request.POST)
        if resign_form.is_valid():
            resign_form.save(request.user.get_profile())
            return redirect('/accounts/settings')
        else:
            return settings(request)

    return HttpResponseNotAllowed(['POST'])