Corrects various errors spoted by travis and codacy

This commit is contained in:
Valentin Samir
2016-08-06 11:44:58 +02:00
parent ed5e3d5226
commit da796c6e01
3 changed files with 25 additions and 7 deletions

View File

@ -372,7 +372,8 @@ class DjangoAuthUser(AuthUser): # pragma: no cover
# _meta.get_fields() is from the new documented _meta interface in django 1.8
try:
field_names = [
field.attname for field in self.user._meta.get_fields() if hasattr(field, "attname")
field.attname for field in self.user._meta.get_fields()
if hasattr(field, "attname")
]
# backward compatibility with django 1.7
except AttributeError: # pragma: no cover (only used by django 1.7)