Provide fallback for when a field has no 'rel' attribute

This commit is contained in:
Jan-Jelle Kester 2015-07-22 00:32:27 +02:00
parent 882415ea18
commit ccaf3925e4

View file

@ -22,7 +22,7 @@ def track_field(field):
return False
# Do not track relations to LogEntry
if getattr(field, 'rel') is not None and field.rel.to == LogEntry:
if getattr(field, 'rel', None) is not None and field.rel.to == LogEntry:
return False
return True