Get the user inside a form class

2009-05-25 Thread Oliver Zheng
I have a ModelForm that has a field of User. I'd like this to be automatically set to whichever user is logged in. I can think of only one solution, passing request.user into the constructor of the form and have save() set it, but it *does not work* for generic views, since they need a form class

settings.LOGIN_URL not redirecting properly

2009-05-13 Thread Oliver Zheng
There is really weird. I noticed that all urls without a slash / at the end redirect to the url with a slash. Thus, users/logout becomes users/logout/. Okay. Now I made a users/login. It works great. I wanted Django to redirect to it for login_required, so I set LOGIN_URL to "users/login". Now, a