mirror of
https://github.com/django/django.git
synced 2025-10-26 15:16:09 +00:00
Fixed #23395 -- Limited line lengths to 119 characters.
This commit is contained in:
committed by
Tim Graham
parent
84b0a8d2aa
commit
b1e33ceced
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user