Opened 17 years ago

Closed 17 years ago

Last modified 16 years ago

#3060 closed defect (fixed)

[patch] broken Timestamp on manual created Users using postgres/sqlite

Reported by: Ronny Pfannschmidt Owned by: nobody
Component: Contrib apps Version:
Severity: normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: yes Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description

while adding a entry for unregistred Users i noticed, that the Model wont use correct timestamps for:

User.objects.get_or_create(username="UnReg",defaults={'id':-1})

,since its using LazyDate as default, wich does only the Date,
unfortunately Mysql is the only supported dbms accepted this, so i added a auto_now_add=True, wich resulted in sqlite and postgresql working, too

Attachments (1)

auth-timestamp-patch.diff (1.4 KB ) - added by Ronny Pfannschmidt <ronny.pfannschmidt@…> 17 years ago.

Download all attachments as: .zip

Change History (8)

by Ronny Pfannschmidt <ronny.pfannschmidt@…>, 17 years ago

Attachment: auth-timestamp-patch.diff added

comment:1 by [Cha0S], 17 years ago

test

comment:2 by Simon G. <dev@…>, 17 years ago

Component: Contrib appsAdmin interface
Triage Stage: UnreviewedReady for checkin

comment:3 by Simon G. <dev@…>, 17 years ago

Component: Admin interfaceContrib apps

comment:4 by Adrian Holovaty, 17 years ago

Needs tests: set
Patch needs improvement: set
Triage Stage: Ready for checkinAccepted

Could we get a unit test that verifies this? Also, what exactly does "broken timestamp" mean? Finally, I'm not in favor of the patch, because auto_now_add is a hack that I'd like to get rid of eventually. If nothing else, it should use default=datetime.datetime.now, taking advantage of the callable default functionality.

comment:5 by Ronny Pfannschmidt <ronny.pfannschmidt@…>, 17 years ago

some dbms didnt accept the date from lazydate - but default=datetime.now is a better solution

comment:6 by Ben Slavin, 17 years ago

Resolution: fixed
Status: newclosed

Looks to me like this was solved in [4985], when LazyDate was pulled.

Please reopen if this didn't fix it for you, but it sounds like you were happy with the solution used to replace LazyDate.

comment:7 by Jacob, 16 years ago

Reporter: changed from Ronny Pfannschmidt <ronny.pfannschmidt@…> to Ronny Pfannschmidt
Note: See TracTickets for help on using tickets.
Back to Top