Opened 9 years ago

Closed 9 years ago

#24737 closed Cleanup/optimization (fixed)

Unnecesary kwarg passed in UserManager's _create_user

Reported by: Luis Del Giudice Owned by: Luis Del Giudice
Component: contrib.auth Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

From django/contrib/auth/models.py

user = self.model(username=username, email=email,
                          is_staff=is_staff, is_active=True,
                          is_superuser=is_superuser,
                          date_joined=now, **extra_fields)

date_joined is being specified but in the model declaration ( line 406 ) date_joined is set to now by default.
406: date_joined = models.DateTimeField(_('date joined'), default=timezone.now

I've removed the date_joined kwarg and all tests were ok. I've pushed what i think is the solution here: https://github.com/delgiudices/django/blob/test_user/django/contrib/auth/models.py#L178

Change History (4)

comment:1 by Luis Del Giudice, 9 years ago

Owner: changed from nobody to Luis Del Giudice
Status: newassigned

comment:2 by Markus Holtermann, 9 years ago

Component: Database layer (models, ORM)contrib.auth
Triage Stage: UnreviewedAccepted
Type: UncategorizedCleanup/optimization
Version: 1.8master

comment:3 by Tim Graham, 9 years ago

Has patch: set
Triage Stage: AcceptedReady for checkin

comment:4 by Tim Graham <timograham@…>, 9 years ago

Resolution: fixed
Status: assignedclosed

In db0a0c4:

Fixed #24737 -- Removed unnecesary kwargs in UserManager._create_user()

Note: See TracTickets for help on using tickets.
Back to Top