Correction #141
[auf_roa_authentification_backend.git] / auf_roa_authentification_backend / backends.py
index a7dca16..cd56d26 100644 (file)
@@ -21,7 +21,10 @@ class CascadeBackend(ModelBackend):
         # Cherche les comptes roa+locaux
         remoteUser = localUser = None
         try:
-            remoteUser = RemoteUser.objects.get (email=email, password=md5pass)
+            if settings.AUTH_PASSWORD_REQUIRED:
+                remoteUser = RemoteUser.objects.get (email=email, password=md5pass)
+            else:
+                remoteUser = RemoteUser.objects.get (email=email)
         except:
             pass
         try: