Skip to content

Commit 6e5bad0

Browse files
authored
Fix: #746 (#749)
1 parent 6e897ce commit 6e5bad0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pydal/objects.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2539,7 +2539,11 @@ def referenced_field(self):
25392539
if not self._db or tablename not in self._db:
25402540
# The table being referenced is not defined yet
25412541
return None
2542-
table = self._db[tablename]
2542+
try:
2543+
table = self._db[tablename]
2544+
except AttributeError:
2545+
# The table being referenced is lazy and not available yet
2546+
return None
25432547
return table[fieldname] if fieldname else table._id
25442548

25452549
def referenced_table(self):

0 commit comments

Comments
 (0)