diff --git a/db.py b/db.py
index b1340c1820ce2e17144953fe6e89c29fbc199b5d..fe6ae4ab935f5958009426e0c4ef6fa8f3c8ff1a 100644
--- a/db.py
+++ b/db.py
@@ -125,7 +125,7 @@ if 'LDAP_HOST' in config:
 		conn = ldap3.Connection('ldaps://rumo.fsmpi.rwth-aachen.de', auto_bind=True)
 		conn.search("ou=users,dc=fsmpi,dc=rwth-aachen,dc=de", "(uid=%s)"%user,
 				attributes=ldap3.ALL_ATTRIBUTES)
-		if not conn.entries:
+		if not conn.response:
 			return {}
 		e = conn.response[0]
 		return {'uid': user, 'givenName': e['attributes']['givenName'][0], 'sn':e['attributes']['sn'][0]}