Skip to content

Commit

Permalink
Simplify NullAutoNowDateTimeField.__init__
Browse files Browse the repository at this point in the history
  • Loading branch information
monosans committed Dec 8, 2023
1 parent 42bdae7 commit fc8bc5a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions socnet/core/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,7 @@ def create_normalized_str_field(field: Type[TField]) -> Type[TField]:
class NullAutoNowDateTimeField(DateTimeField[T_contra, T_co]):
@copy_type_hints(DateTimeField.__init__)
def __init__(self, **kwargs: Any) -> None:
kwargs["auto_now"] = True
kwargs["auto_now_add"] = False
kwargs["null"] = True
super().__init__(**kwargs)
super().__init__(**kwargs, auto_now=True, auto_now_add=False, null=True)

@override
def pre_save(self, model_instance: Model, add: bool) -> Any:
Expand Down

0 comments on commit fc8bc5a

Please sign in to comment.