From b1e33ceceda1e75ff68c7deed8f6659683a195d3 Mon Sep 17 00:00:00 2001 From: Dražen Odobašić Date: Fri, 11 Sep 2015 19:33:12 -0400 Subject: Fixed #23395 -- Limited line lengths to 119 characters. --- django/forms/models.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'django/forms') diff --git a/django/forms/models.py b/django/forms/models.py index 651749a356..0fba08855f 100644 --- a/django/forms/models.py +++ b/django/forms/models.py @@ -788,8 +788,12 @@ class BaseModelFormSet(BaseFormSet): # True, so check for that as well. def pk_is_not_editable(pk): - return ((not pk.editable) or (pk.auto_created or isinstance(pk, AutoField)) - or (pk.remote_field and pk.remote_field.parent_link and pk_is_not_editable(pk.remote_field.model._meta.pk))) + return ( + (not pk.editable) or (pk.auto_created or isinstance(pk, AutoField)) or ( + pk.remote_field and pk.remote_field.parent_link + and pk_is_not_editable(pk.remote_field.model._meta.pk) + ) + ) if pk_is_not_editable(pk) or pk.name not in form.fields: if form.is_bound: # If we're adding the related instance, ignore its primary key -- cgit v1.3