Opened 16 years ago

Closed 16 years ago

Last modified 13 years ago

#8359 closed (fixed)

Adding a user in admin doesn't create a LogEntry for the addition

Reported by: evan_schulz Owned by: nobody
Component: contrib.admin Version: dev
Severity: 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

UserAdmin's add_view method doesn't call the log_addition method to create a record that the new user was created which means you'll get the incorrect message "object doesn't have a change history. It probably wasn't added via this admin site" when viewing the user history.

Attachments (2)

8359.diff (637 bytes ) - added by evan_schulz 16 years ago.
8359choices.diff (1.8 KB ) - added by rockmhoward@… 16 years ago.
Optional additional patch to fix object history display.

Download all attachments as: .zip

Change History (10)

by evan_schulz, 16 years ago

Attachment: 8359.diff added

comment:1 by Alex Gaynor, 16 years ago

milestone: 1.0
Triage Stage: UnreviewedReady for checkin

comment:2 by Malcolm Tredinnick, 16 years ago

A bit hard to verify the fix until #8353 has been fixed. :-)

comment:3 by evan_schulz, 16 years ago

FWIW there is a small patch in #8357 to get user creation working again for quick verification purposes

by rockmhoward@…, 16 years ago

Attachment: 8359choices.diff added

Optional additional patch to fix object history display.

comment:4 by rockmhoward@…, 16 years ago

The 8359choices.diff patch fixes the problem whereby the object history displays no action when no change_message was specified. With this fix a default action description ("Added.", "Changed." or "Deleted.") is displayed based on the action_flag setting when change_message is not set.

comment:5 by Malcolm Tredinnick, 16 years ago

The second patch should go into a new ticket and we can consider that after 1.0. It's a feature addition, since it restricts the choices on the actions available in the LogEntry model, which may or may not be what we want to do.

comment:6 by Malcolm Tredinnick, 16 years ago

Resolution: fixed
Status: newclosed

(In [8503]) Fixed #8359 -- Add an admin log entry when creating a new user.
Patch from evan_schulz.

in reply to:  5 comment:7 by rockmhoward@…, 16 years ago

Replying to mtredinnick:

The second patch should go into a new ticket and we can consider that after 1.0. It's a feature addition, since it restricts the choices on the actions available in the LogEntry model, which may or may not be what we want to do.

This is a weak decision. First off, the bug as submitted is not entirely fixed without the second patch since the logentry for the user addition still does not show up as an addition in the object history. Second, the choices on the action_flag are already restricted to a SmallPositiveInteger. If you are seriously concerned about restricting the values, you need to change this to an IntegerField at the very least. Third, set theory suggests that the defined actions -- addition, deletion and change -- are all of the possible actions available for any object. There are no other choices that would not logically overlap the available choices. If you want to argue that set theory is incomplete and new types of state transitions that are not changes or additions or deletions may be discovered someday, then your comment is valid. Otherwise it simply perpetuates a wart that is trivially fixed as my patch demonstrates.

comment:8 by Jacob, 13 years ago

milestone: 1.0

Milestone 1.0 deleted

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