diff options
| author | Dražen Odobašić <dodobas@candela-it.com> | 2015-09-11 19:33:12 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-09-12 11:40:50 -0400 |
| commit | b1e33ceceda1e75ff68c7deed8f6659683a195d3 (patch) | |
| tree | e4e446f69194f2dc3c9c7ee3ecf48290ea8d4d31 /django/forms/models.py | |
| parent | 84b0a8d2aad042fb573df5055b6153770d0929ac (diff) | |
Fixed #23395 -- Limited line lengths to 119 characters.
Diffstat (limited to 'django/forms/models.py')
| -rw-r--r-- | django/forms/models.py | 8 |
1 files changed, 6 insertions, 2 deletions
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 |
