- c = {'talk': talk, 'form': form, 'improve': improve}
- return render_to_response('eventos/talk_improve.html', Context(c),
+ c = {'talk': talk, 'form': form, 'improve': improve,
+ 'len_comments': len(improve), 'speakers': speakers}
+ return render_to_response('eventos/talk-improve.html', Context(c),
+ context_instance=RequestContext(request))
+
+def subscribe(request):
+ """This view shows a form with name, login and password fields and
+ if it receives a post, it will get data from the above fields and
+ create an User (yes, the django User). I think this user will be
+ used as an attendee.
+
+ This function authenticates the new user.
+ """
+ form = SubscribeForm(request.POST or None)
+
+ if request.POST and form.is_valid():
+ new_user = User.objects.create_user(request.POST['username'],
+ request.POST['email'],
+ request.POST['password'])
+ login(request)
+ return HttpResponseRedirect('/')
+
+ context = {'form': form}
+ return render_to_response('eventos/subscribe.html', Context(context),