Skip to content
Snippets Groups Projects
Commit 40ee661e authored by Julian Rother's avatar Julian Rother
Browse files

Catch NULL dn values in 1-n-DBRelationship

parent 06dec554
No related branches found
No related tags found
No related merge requests found
......@@ -59,7 +59,10 @@ class DBRelationship:
return self
if self.mapcls is not None:
return DBRelationshipSet(obj, self.relattr, self.ldapcls, self.mapcls)
return self.ldapcls.query.get(getattr(obj, self.relattr))
dn = getattr(obj, self.relattr)
if dn is not None:
return self.ldapcls.query.get(dn)
return None
def __set__(self, obj, values):
if self.mapcls is not None:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment