Skip to content

Commit

Permalink
Fixed bug in PyFlakes patch
Browse files Browse the repository at this point in the history
  • Loading branch information
palewire committed Feb 12, 2016
1 parent 33bdffe commit d7efd1f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions postgres_copy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ def __init__(
except KeyError:
raise ValueError("Map does not include %s field" % h)
try:
[f for f in self.model._meta.fields if f.name == f_name][0]
f = [f for f in self.model._meta.fields if f.name == f_name][0]
except IndexError:
raise ValueError("Model does not include %s field" % f_name)
self.field_header_crosswalk.append((f, h))

# Validate that the static mapping columns exist
for f_name in self.static_mapping.keys():
try:
[f for f in self.model._meta.fields if f.name == f_name][0]
[s for s in self.model._meta.fields if s.name == f_name][0]
except IndexError:
raise ValueError("Model does not include %s field" % f_name)

Expand Down
2 changes: 1 addition & 1 deletion tests/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class MockObject(models.Model):
name = models.CharField(max_length=500)
number = MyIntegerField(null=True, db_column='num')
dt = models.DateField(null=True)
parent = models.ForeignKey('MockObject', null=True)
parent = models.ForeignKey('MockObject', null=True, default=None)

class Meta:
app_label = 'tests'
Expand Down

0 comments on commit d7efd1f

Please sign in to comment.