X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fprojects%2Fxerxes.git;a=blobdiff_plain;f=auth.py;h=00c106d1e36625e6571d045c2d8604cdbf399b0e;hp=88f9f63fbfd190427144ebc8c6fad7ae5b27f7c6;hb=HEAD;hpb=25f8408523048e3734758d970efaf12b1d7157db diff --git a/auth.py b/auth.py index 88f9f63..00c106d 100644 --- a/auth.py +++ b/auth.py @@ -63,7 +63,7 @@ class PhpBBBackend: # No data? No login. if (cursor.rowcount == 0): - print("User %s not found", username) + conn.close() return False # Check password @@ -82,21 +82,18 @@ class PhpBBBackend: Most of this code has been taken from Django's user auth tutorial. """ def authenticate(self, username=None, password=None): - print password email = self.check_login(username, password) if email: - print "Login checked out" try: user = User.objects.get(username=username) except User.DoesNotExist: - print "User did nog exist" # Create a new user. Note that we can set password # to anything, because it won't be checked; the password # from settings.py will. user = User(username=username, password='get from settings.py') user.email = email + user.set_unusable_password() user.save() - print user return user else: return None @@ -107,3 +104,4 @@ class PhpBBBackend: except User.DoesNotExist: return None +# vim: set sts=4 sw=4 expandtab: