Python

Python

By DeepSource

Redundant default=None for a model field PTC-W0907

Style
Autofix

If field is nullable (null=True), then it is unnecessary to provide default=None since this is implicit. It is recommended to remove default=None kwarg.

Not Preferred:

class SomeModel(models.Model):
    some_field = models.EmailField(null=True, default=None)

Preferred:

class SomeModel(models.Model):
    some_field = EmailField(null=True)