@@ -60,9 +60,9 @@ def references_field(self, model_name, name, app_label=None):
6060 return True
6161 return False
6262
63- def reduce (self , operation , app_label = None ):
63+ def reduce (self , operation , app_label ):
6464 return (
65- super ().reduce (operation , app_label = app_label ) or
65+ super ().reduce (operation , app_label ) or
6666 not operation .references_field (self .model_name , self .name , app_label )
6767 )
6868
@@ -122,7 +122,7 @@ def database_backwards(self, app_label, schema_editor, from_state, to_state):
122122 def describe (self ):
123123 return "Add field %s to %s" % (self .name , self .model_name )
124124
125- def reduce (self , operation , app_label = None ):
125+ def reduce (self , operation , app_label ):
126126 if isinstance (operation , FieldOperation ) and self .is_same_field_operation (operation ):
127127 if isinstance (operation , AlterField ):
128128 return [
@@ -142,7 +142,7 @@ def reduce(self, operation, app_label=None):
142142 field = self .field ,
143143 ),
144144 ]
145- return super ().reduce (operation , app_label = app_label )
145+ return super ().reduce (operation , app_label )
146146
147147
148148class RemoveField (FieldOperation ):
@@ -186,11 +186,11 @@ def database_backwards(self, app_label, schema_editor, from_state, to_state):
186186 def describe (self ):
187187 return "Remove field %s from %s" % (self .name , self .model_name )
188188
189- def reduce (self , operation , app_label = None ):
189+ def reduce (self , operation , app_label ):
190190 from .models import DeleteModel
191191 if isinstance (operation , DeleteModel ) and operation .name_lower == self .model_name_lower :
192192 return [operation ]
193- return super ().reduce (operation , app_label = app_label )
193+ return super ().reduce (operation , app_label )
194194
195195
196196class AlterField (FieldOperation ):
@@ -256,7 +256,7 @@ def database_backwards(self, app_label, schema_editor, from_state, to_state):
256256 def describe (self ):
257257 return "Alter field %s on %s" % (self .name , self .model_name )
258258
259- def reduce (self , operation , app_label = None ):
259+ def reduce (self , operation , app_label ):
260260 if isinstance (operation , RemoveField ) and self .is_same_field_operation (operation ):
261261 return [operation ]
262262 elif isinstance (operation , RenameField ) and self .is_same_field_operation (operation ):
@@ -268,7 +268,7 @@ def reduce(self, operation, app_label=None):
268268 field = self .field ,
269269 ),
270270 ]
271- return super ().reduce (operation , app_label = app_label )
271+ return super ().reduce (operation , app_label )
272272
273273
274274class RenameField (FieldOperation ):
@@ -382,7 +382,7 @@ def references_field(self, model_name, name, app_label=None):
382382 name .lower () == self .new_name_lower
383383 )
384384
385- def reduce (self , operation , app_label = None ):
385+ def reduce (self , operation , app_label ):
386386 if (isinstance (operation , RenameField ) and
387387 self .is_same_model_operation (operation ) and
388388 self .new_name_lower == operation .old_name_lower ):
@@ -396,6 +396,6 @@ def reduce(self, operation, app_label=None):
396396 # Skip `FieldOperation.reduce` as we want to run `references_field`
397397 # against self.new_name.
398398 return (
399- super (FieldOperation , self ).reduce (operation , app_label = app_label ) or
399+ super (FieldOperation , self ).reduce (operation , app_label ) or
400400 not operation .references_field (self .model_name , self .new_name , app_label )
401401 )
0 commit comments