mirror of
https://github.com/django/django.git
synced 2025-11-25 05:04:26 +00:00
Fixed #32676 -- Prevented migrations from rendering related field attributes when not passed during initialization.
Thanks Simon Charette for the implementation idea.
This commit is contained in:
parent
b746596f5f
commit
b9df2b74b9
4 changed files with 80 additions and 13 deletions
|
|
@ -34,7 +34,12 @@ class CustomManyToManyField(RelatedField):
|
|||
self.db_table = db_table
|
||||
if kwargs['rel'].through is not None:
|
||||
assert self.db_table is None, "Cannot specify a db_table if an intermediary model is used."
|
||||
super().__init__(**kwargs)
|
||||
super().__init__(
|
||||
related_name=related_name,
|
||||
related_query_name=related_query_name,
|
||||
limit_choices_to=limit_choices_to,
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
def contribute_to_class(self, cls, name, **kwargs):
|
||||
if self.remote_field.symmetrical and (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue