Commit Graph

97 Commits

Author SHA1 Message Date
Gary Wilson Jr 56e1cdc8bc Fixed a long and complex line by breaking into a for loop, with the added benefit that the method will now exit as soon as a matching
permission is found instead of checking all of the user's permissions and putting them into a temporary list.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7823 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-02 05:05:50 +00:00
Gary Wilson Jr 73dfef8771 Added docstring and other minor style fixes.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7822 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-02 05:00:09 +00:00
Russell Keith-Magee 8cb128e57c Refs #7521 -- Re-reverted [7716] (originally reverted in [7726]), now modified to use the new TestCase urlpattern framework.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7808 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-30 13:11:12 +00:00
Malcolm Tredinnick 339df5ce44 Fixed #6089 -- Removed default ordering on the User class.
Admin users are still ordered, since we add it in specially for Admin. Slightly
backwards incompatible.

Patch from Erik Karulf.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7806 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-30 12:52:46 +00:00
Adrian Holovaty fbef599f60 Fixed #6306 -- redirect_to_login() helper function now quotes the URL arguments correctly. Thanks, SmileyChris
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7749 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-26 04:11:53 +00:00
Adrian Holovaty 54f7da3a27 Fixed #7274 -- Improved the django.contrib.auth password_reset() view not to require the Sites framework. Thanks, joshrl
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7748 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-26 04:09:29 +00:00
Russell Keith-Magee c8d39f15cb Fixed #7521 -- Reverted [7716]. Fixed URLs in test case broke any application that deployed contrib.auth.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7726 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-23 12:17:57 +00:00
Luke Plant fad8e8f7c2 Added basic tests for auth.views.password_reset
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7716 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-20 17:43:12 +00:00
Jacob Kaplan-Moss 2b62e945b0 Fixed #3393: login view no longer assumes that set_test_cookie has been called. This is mildly backwards-incompatible, but in the "now it works the way it should have all along" sense. Thanks to James and lcordier for the patches.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7692 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-18 16:13:14 +00:00
Jacob Kaplan-Moss b0ebcfe15a Fixed #7394: fixed bug with syncdb and createsuperuser introduced in [7590]. Thanks, av0000@mail.ru
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7598 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-08 18:18:01 +00:00
Russell Keith-Magee 8398ea6603 Fixed #7392 -- Corrected a typo in the backwards-compatibility layer to the new createsuperuser command.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7596 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-08 08:45:14 +00:00
Jacob Kaplan-Moss 5675ae4443 Fixed #5614: added 'manage.py createsuperuser'. Thanks, programmerq.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7590 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-08 05:31:16 +00:00
Malcolm Tredinnick 6dfe245f02 Updated the inline help text for User.is_active.
Fixed #6881. Refs #7011.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7414 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-04-13 01:50:29 +00:00
Gary Wilson Jr a75e58be58 Fixed #5922 -- Turned `ModelBackend` authentication backend into a new-style class, thanks `Honza_Kral`.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7201 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-03-08 03:09:29 +00:00
Gary Wilson Jr 5ca0b9203b Fixed #5701 -- Fixed decorators to take the name, attributes, and docstring of the function they decorate by adding a modified version of the `functools.wraps` function from Python 2.5. `wraps` has been altered to work with Django's `curry` function and with Python 2.3, which doesn't allow assignment of a function's `__name__` attribute. This fixes severaly annoyances, such as the online documentation for template filters served by the admin app. This change is backwards incompatible if, for some reason, you were relying on the name of a Django decorator instead of the function it decorates.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7153 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-02-25 06:02:35 +00:00
Gary Wilson Jr 298d76aed4 Fixed #3165 -- Really allow underscores when making a superuser, thanks `SmileyChris`.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7018 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-01-13 04:03:36 +00:00
Gary Wilson Jr a4478ee9c6 Fixed #6174 -- Made `AnonymousUser.is_active` False instead of True since `AnonymousUser`s can't login. Thanks, `SmileyChris`.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6912 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-11 06:37:07 +00:00
Luke Plant 8c9b65429a Fixed bug in /admin/doc/views/ caused by [6658]
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6659 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-09 15:27:49 +00:00
Luke Plant 8eeb9feab0 Fixed #4376 -- login_required now works with bound methods. Thanks, Steven Bethard.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6658 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-07 22:45:07 +00:00
Malcolm Tredinnick 212aa32e2a Fixed #5798 -- Added a missing translation marker. Thanks, maru.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6617 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-27 04:34:50 +00:00
Russell Keith-Magee d95c0fd017 Fixed #5636 -- Added missing Set import for Python2.3 support. Thanks, wangchun@exoweb.net.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6438 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-30 04:11:29 +00:00
Jacob Kaplan-Moss f857e37776 Fixed $5457 - the auth system now delegates permission checking to auth backend(s). As an added bonus, the auth backends now have some unit tests! Thanks, Florian Apolloner.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6375 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-19 16:50:30 +00:00
Adrian Holovaty bcfaa73514 Fixed #3604 -- django.contrib.auth password checking now uses hashlib if it's available. Thanks, Rob Hudson
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6318 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-15 19:45:33 +00:00
Jacob Kaplan-Moss 40702fe2f0 Small change to modpython auth handler to support Apache 2.2
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6305 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-15 18:36:31 +00:00
Malcolm Tredinnick 388182b622 Fixed #3032 -- Added some useful methods and attributes so that AnonymousUser can proxy for a User a bit more logically. Patch from semenov.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6299 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-15 18:01:29 +00:00
Adrian Holovaty ddd3d7c71f Fixed #5308 -- Redirect from pages that need login and have Unicode URL no longer causes error. Thanks, webjunkie
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6226 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-14 21:53:15 +00:00
Adrian Holovaty 55d6aebfec Fixed #5394 -- REDIRECT_FIELD_NAME is now configurable. Thanks, Petr Marhoun, DavidReynolds and effbot
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6206 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-14 19:25:37 +00:00
Adrian Holovaty 375c88d2bc Fixed #5227 -- Made the redirect security check in django.contrib.auth.views.login() tighter. Thanks, Sander Dijkhuis
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6004 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-25 18:34:28 +00:00
Adrian Holovaty 221f99ed58 Refactored quote_name() to DatabaseOperations.quote_name(). Refs #5106
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5967 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-20 01:03:33 +00:00
Adrian Holovaty b38375ee4c Fixed bug in [5885]
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5886 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-14 22:26:34 +00:00
Adrian Holovaty 6aae9b2aa4 Changed django.contrib.auth.views.login to use RequestSite if the sites framework is not installed -- i.e., the sites framework is no longer required to use this view. See also [5654]
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5885 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-14 22:08:11 +00:00
Gary Wilson Jr 212ee65be7 Fixed #2101 -- Renamed `maxlength` argument to `max_length` for oldforms `FormField`s and db model `Field`s. This is fully backwards compatible at the moment since the legacy `maxlength` argument is still supported. Using `maxlength` will, however, issue a `PendingDeprecationWarning` when used.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5803 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-05 05:14:46 +00:00
Simon Willison fd2b99b5f1 After discussing with Malcolm, added set_unusable_password() and has_usable_password() methods to the User object, plus tests and updated documentation
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5771 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-28 18:30:40 +00:00
Russell Keith-Magee 6335317a42 Fixed #3505 -- Added handling for the error raised when the user forgets the comma in a single element tuple when defining AUTHENTICATION_BACKENDS. Thanks for the help identifying this problem, Mario Gonzalez <gonzalemario@gmail.com>.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5678 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-13 05:03:33 +00:00
Malcolm Tredinnick 953badbea5 Merged Unicode branch into trunk (r4952:5608). This should be fully
backwards compatible for all practical purposes.

Fixed #2391, #2489, #2996, #3322, #3344, #3370, #3406, #3432, #3454, #3492, #3582, #3690, #3878, #3891, #3937, #4039, #4141, #4227, #4286, #4291, #4300, #4452, #4702


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5609 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-04 12:11:04 +00:00
Malcolm Tredinnick 179f478ffe Fixed #4751 -- Fixed that AnonymousUser.__str__ to always return a string
object, as required by Python.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5590 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-03 12:24:46 +00:00
Malcolm Tredinnick 17145eef4c Removed unneeded import.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5536 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-06-25 16:10:33 +00:00
Malcolm Tredinnick 08aa5c585b Fixed #4607 -- Tweaked checks for features missing in Python 2.3 to not assume
things Python does not guarantee. Patch from SmileyChris.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5514 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-06-23 03:18:22 +00:00
Luke Plant 18619a11ee Fixed behaviour of contrib.auth.forms.PasswordResetForm when more than
one User have the same e-mail address.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5493 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-06-19 20:04:54 +00:00
Malcolm Tredinnick 44dd91ec6d Fixed #4015 -- Changed login() and logout() messages to update request.user if
it is relevant. Thanks James Bennett, Vinay Sajip and Gary Wilson.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5472 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-06-15 01:53:40 +00:00
Malcolm Tredinnick 74bab89178 Fixed #3379 -- Changed login() so that we update last_login when a user
logs in. Thanks, arvin.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5074 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-04-25 09:44:06 +00:00
Malcolm Tredinnick 2a7d9ef23f Fixed #3316 -- Added support for crypt hashing of passwords, mostly to support
easy porting from existing Unix-based legacy apps. Thanks, axiak@mit.edu.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5073 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-04-25 09:34:29 +00:00
Malcolm Tredinnick 5dfe74f221 Fixed #3185 -- Made values for login, logout and post-login redirect URLs
configurable. This is a combined patch from Vasily Sulatskov, Marc Fargas and
Collin Grady.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5072 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-04-25 08:49:57 +00:00
Malcolm Tredinnick 00cb6a1ba8 Fixed #4107 -- Marked a few more strings for translation. Thanks, Baptiste.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5061 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-04-23 05:51:29 +00:00
Russell Keith-Magee bbeb62c9af Backwards-incompatible change -- Removed LazyDate helper class. To preserve existing functionality, query arguments can now be callable. Callable query arguments are evaluated with the query is evaluated.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4985 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-04-09 13:28:09 +00:00
Adrian Holovaty c7f6cd0243 Added blank lines around Meta and Admin classes in django.contrib.auth.models
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4945 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-04-07 04:21:31 +00:00
Adrian Holovaty 796b2304f3 Fixed #3773 -- Added app_label to Permission.__str__(), so that the admin permission list is easier to use with multiple permissions of the same name. Thanks, mrmachine
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4823 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-03-25 21:28:59 +00:00
Malcolm Tredinnick 6c4757729b Revert [4485] in order to fix accidental mod_python breakage. Refs #2920.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4486 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-11 23:50:35 +00:00
Russell Keith-Magee 0e924c70b1 Refs #2920 -- Replaced implicit uses of _() with explicit imports or calls to gettext(). At some point post 0.96, we need to remove the calls that put _ into the builtins.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4485 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-11 06:20:52 +00:00
Russell Keith-Magee f9cdde0cb4 Fixed #3162 -- Added coded to catch and rethrow exceptions that are thrown by the views visited by the test client. Thanks, Ben <afternoon@uk2.net>.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4482 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-11 00:23:31 +00:00