mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +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:
committed by
Mariusz Felisiak
parent
b746596f5f
commit
b9df2b74b9
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user