Re: Overwriting the login function

2007-08-09 Thread Matt Davies
OK, I got it. You can't use the login_decorator to do what I'm trying to do. I"ve addded one simple line to the form, used the original auth/views.py and my original method of authentication and it all works fine. Misread the docs again. return HttpResponseRedirect('/accounts/login/?next=%s' %

Re: Overwriting the login function

2007-08-08 Thread Matt Davies
Ok, I'm now using the login_required decorator, much better one problem though, here's a snippet of a form http://pastie.caboo.se/85932 How do I check the IP prior to askign for a login check, and if the IP is good, not ask for login? I'm stumped On 08/08/07, Matt Davies <[EMAIL

Re: Overwriting the login function

2007-08-08 Thread Matt Davies
Getting there. It's not setting the logged in as yes as it's not logging me in :-) This conditional in the login function in views if request.POST: is not getting a positive and it's falling through to the else which is setting errors to blank else: print 'balls' errors = {}

Overwriting the login function

2007-08-08 Thread Matt Davies
I've copied the /contrib/auth/views.py into my project and edited it like so redirect_to = request.META["HTTP_REFERER"] return render_to_response(template_name, { 'form': oldforms.FormWrapper(manipulator, request.POST, errors), 'matts_back_to': redirect_to, 'site_name':