diff options
| author | Russell Keith-Magee <russell@keith-magee.com> | 2006-09-30 01:21:03 +0000 |
|---|---|---|
| committer | Russell Keith-Magee <russell@keith-magee.com> | 2006-09-30 01:21:03 +0000 |
| commit | fa4bb1b0933ac5b1b266269d20f1a40808f822ab (patch) | |
| tree | 1efc3279d4f8b781b9d3f8dfba85c8538763d83b /django | |
| parent | 14fb13da7ef3137a6b166c77724c3d790795e212 (diff) | |
Clarified documentation to indicate that authenticating a user doesn't imply that they are active. Reinforced the fact that has_perm only returns true if user is active, and fixed a minor bug to that effect.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3885 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
| -rw-r--r-- | django/contrib/auth/models.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/django/contrib/auth/models.py b/django/contrib/auth/models.py index eb5713ba57..73bcfe92aa 100644 --- a/django/contrib/auth/models.py +++ b/django/contrib/auth/models.py @@ -216,6 +216,8 @@ class User(models.Model): def has_module_perms(self, app_label): "Returns True if the user has any permissions in the given app label." + if not self.is_active: + return False if self.is_superuser: return True return bool(len([p for p in self.get_all_permissions() if p[:p.index('.')] == app_label])) |
