Projet

Général

Profil

Télécharger (529 octets) Statistiques
| Branche: | Tag: | Révision:

root / uauth / backends.py @ b3843f12

1
from .organization.models import LocalAccount
2
from datetime import datetime
3

    
4
class LocalAccountPasswordBackend(object):
5

    
6
    def authenticate(self, login, password, organization):
7
        try:
8
            account = LocalAccount.objects.get(username=login, active=True,
9
                                               organization=organization)
10
            if account.password == password:
11
                if not account.expired:
12
                    return account
13
        except LocalAccount.DoesNotExist:
14
            return None
(3-3/10)