Code

Opened 6 years ago

Closed 6 years ago

#7370 closed (fixed)

Changing user in admin deletes UserProfile

Reported by: jeverling Owned by: nobody
Component: contrib.admin Version: master
Severity: Keywords: UserProfile Admin User deletes
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description (last modified by ramiro)

Hello everybody!

For me, changing a user in the admin interface, for example adding a first_name, deletes the corresponding UserProfile.
This doesn't happen when using the shell, only via the admin interface.
Both in current svn, and in 0.96.2.
I have created the UserProfile like so:

models.py:

class UserProfile(models.Model):
    user = models.ForeignKey(User, unique=True, edit_inline=models.TABULAR, num_in_admin=1,min_num_in_admin=1, max_num_in_admin=1, num_extra_on_change=0, core=True)

settings.py:

AUTH_PROFILE_MODULE = 'myapp.UserProfile'

It works great, just changing a user in the admin interface deletes the UserProfile.
If this is in any way related to a wrong setup on my side, please excuse this ticket!

Best Regards!

Attachments (0)

Change History (4)

comment:1 Changed 6 years ago by ramiro

  • Description modified (diff)
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 6 years ago by chris.vigelius@…

Same thing here (current SVN). May very well be that this has been broken by the merge queryset-refactor, as I remember this having worked before.

However, given the fact that nfa is expected to land pretty soon, and since there is an obvious workaround (remove inline editing from the model definition) which does not break anything but only causes some inconvenience (you can still edit the profile via admin, just not inline), I doubt whether it is really effective to spend much time on this issue.

comment:3 Changed 6 years ago by anonymous

Do any of your other fields have "core=True"?

If not, add core=true to some or allyour userprofile fields and try again.

comment:4 Changed 6 years ago by jamesturk

  • Resolution set to fixed
  • Status changed from new to closed

this bug does not apply to newforms-admin

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.