diff --git a/inside/authentication.py b/inside/authentication.py index 945e387..9930e3c 100644 --- a/inside/authentication.py +++ b/inside/authentication.py @@ -19,6 +19,7 @@ class InsideBackend(object): inside_user = InsideUser.objects.filter( Q(password=password_hash) & (Q(ldap_username=username) | Q(email=username)) ) + # TODO log all login attempts # AuthLog.objects.create() if not len(inside_user) == 1: diff --git a/inside/models.py b/inside/models.py index f4e2c83..c5bd416 100644 --- a/inside/models.py +++ b/inside/models.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals from django.db import models - +import datetime class Action(models.Model): connection_name = 'inside' @@ -352,6 +352,9 @@ class InsideUser(models.Model): created = models.DateTimeField(blank=True, null=True) membership_trial = models.CharField(max_length=255) + # ugly hack to use django internals for password reset + last_login = datetime.datetime(2001, 1, 1) + def __unicode__(self): if not self.ldap_username: return 'User {}'.format(self.pk)