def registration(request): if request.method == 'POST': form = RegistrationForm(request.POST) if form.is_valid(): user = UserAccount(email = form.cleaned_data['email'], type = 1, status=1, username = form.cleaned_data['username'], password = form.cleaned_data['password'], on_announce_list = form.cleaned_data['on_announce_list']) user.save() login_user(request, user) copy_folder(get_object_or_404(Folder, user=settings.DEFAULT_USER_ID, default_folder=True), user) else: form = RegistrationForm() if request.is_logged_in: return render_to_response('register-confirm.html', context_instance=RequestContext(request)) return render_to_response('register.html', { 'form': form }, context_instance=RequestContext(request))
def _create_anonymous_user(request): user = UserAccount(type=1, status=1) user.save() login_user(request,user) return utils.copy_folder(get_object_or_404(folder_models.Folder, user=settings.DEFAULT_USER_ID, default_folder=True), user)