Removed Nexus, switched to default backends

This commit is contained in:
2012-05-20 18:13:35 +01:00
parent 1c675338c6
commit 3bad0c6c4e
4 changed files with 7 additions and 34 deletions

View File

@@ -1,26 +0,0 @@
from django.contrib.auth.backends import ModelBackend
from django.contrib.auth.models import User
from hashlib import sha1
class SimpleHashModelBackend(ModelBackend):
supports_anonymous_user = False
supports_object_permissions = False
supports_inactive_user = False
def authenticate(self, username=None, password=None):
try:
user = User.objects.get(username=username)
except User.DoesNotExist:
return None
if '$' in user.password:
if user.check_password(password):
return user
else:
if user.password == sha1(password).hexdigest():
user.set_password(password)
return user
return None