def user_settings(request):
logger.debug('settings view triggered by %s' % (request.user.username))
form = ContactForm(request.POST, instance=Contact.objects.get(user=request.user.id))
if form.is_valid:
try:
form.save()
return HttpResponse('Done', status=200)
except:
return HttpResponse(json.dumps(form.errors), status=409)
else:
return HttpResponse(json.dumps(form.errors), status=409)
return render(request, 'isubscribe/user_settings.html', {'DATA':data, 'form': form})
评论列表
文章目录