Skip to content

Commit 168eecc

Browse files
author
Ross Mechanic
authored
Fix flake8 error and pin flake8 to 3.6.0 (#466)
1 parent 944d512 commit 168eecc

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ env:
1515

1616
install:
1717
- pip install -U coverage codecov
18-
- pip install -U flake8
18+
- pip install -U flake8==3.6.0
1919
- pip install -U $DJANGO
2020
- pip freeze
2121

simple_history/management/commands/populate_history.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,17 @@ def _model_from_natural_key(self, natural_key):
9595
except LookupError:
9696
model = None
9797
if not model:
98-
raise ValueError(self.MODEL_NOT_FOUND +
99-
" < {model} >\n".format(model=natural_key))
98+
msg = self.MODEL_NOT_FOUND + " < {model} >\n".format(
99+
model=natural_key
100+
)
101+
raise ValueError(msg)
100102
try:
101103
history_model = utils.get_history_model_for_model(model)
102104
except NotHistoricalModelError:
103-
raise ValueError(self.MODEL_NOT_HISTORICAL +
104-
" < {model} >\n".format(model=natural_key))
105+
msg = self.MODEL_NOT_HISTORICAL + " < {model} >\n".format(
106+
model=natural_key
107+
)
108+
raise ValueError(msg)
105109
return model, history_model
106110

107111
def _bulk_history_create(self, model, batch_size):

0 commit comments

Comments
 (0)