mirror of
https://github.com/nikdoof/django-testauth.git
synced 2025-12-18 20:29:26 +00:00
Convert to a installable package
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
||||
*.pyc
|
||||
build
|
||||
|
||||
@@ -7,9 +7,9 @@ from hashlib import sha1
|
||||
from django.contrib.auth.models import User, check_password, Group
|
||||
import settings
|
||||
|
||||
class DredditAuthBackend:
|
||||
class TESTAuthBackend:
|
||||
"""
|
||||
Django authentication backend for authenticating against Dreddit's Auth System.
|
||||
Django authentication backend for authenticating against TEST's Auth System.
|
||||
"""
|
||||
def authenticate(self, username=None, password=None):
|
||||
|
||||
@@ -39,7 +39,7 @@ class DredditAuthBackend:
|
||||
if email:
|
||||
user.email = email
|
||||
|
||||
if hasattr(settings, 'DREDDIT_AUTH_CREATE_GROUPS') and settings.DREDDIT_AUTH_CREATE_GROUPS:
|
||||
if getattr(settings, 'TEST_AUTH_CREATE_GROUPS', False):
|
||||
for g in groups:
|
||||
group, created = Group.objects.get_or_create(name=g['name'])
|
||||
user.groups.add(group)
|
||||
Reference in New Issue
Block a user