Skip to content

Commit

Permalink
Don't crash if ForeignKey field doesn't have keyword arguments
Browse files Browse the repository at this point in the history
Fixes #230
  • Loading branch information
atodorov committed Apr 26, 2019
1 parent 8a034c6 commit 37430cf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pylint_django/transforms/foreignkey.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ def _get_model_class_defs_from_module(module, model_name, module_name):


def infer_key_classes(node, context=None):
keyword_args = [kw.value for kw in node.keywords]
keyword_args = []
if node.keywords:
keyword_args = [kw.value for kw in node.keywords]
all_args = chain(node.args, keyword_args)

for arg in all_args:
Expand Down

0 comments on commit 37430cf

Please sign in to comment.