Ejemplo n.º 1
0
def register(request):
	form = registerForm(request.POST or None)
	if form.is_valid():
		user = form.save()
		user.backend = settings.AUTHENTICATION_BACKENDS[0]
		login(request, user)
		return redirect(reverse('account_profile'))
	ctx={'form': form,}
	return render_to_response('account/register.html', ctx, context_instance=RequestContext(request))
Ejemplo n.º 2
0
def editRegister(request):
	if request.method == 'POST':
		form = registerForm(request.POST or None)
	else:
		usuario = userProfile.objects.get(id=request.user.id)
		dictionary = model_to_dict(usuario, fields=[], exclude=[])
		form = editRegisterForm(dictionary) 
	if form.is_valid():
		form.save()

	ctx={'form': form,}
	return render_to_response('account/editRegister.html', ctx, context_instance=RequestContext(request))