Code

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#2663 closed defect (fixed)

[patch] [per-object-permissions] pop admin broken

Reported by: Joeboy Owned by: clong
Component: contrib.admin Version:
Severity: normal Keywords: per-object-permissions, row-level
Cc: django25@… Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

I guess this is my fault for using unmerged branches, but this all looks a bit broken to me.

row_level_perm_manipulator contains the following:

if str(value) == str_data:
    selected_html = ' selected="selected"'

which is supposed to set the default value of the user/group boxes. However at this point, value contains things like 'group-3' and str_data contains things like 'auth/group/3'. Consequently the boxes always default to 'admin'.

Attachments (1)

pop-admin-fix.patch (1.0 KB) - added by Joeboy 8 years ago.

Download all attachments as: .zip

Change History (5)

Changed 8 years ago by Joeboy

comment:1 Changed 8 years ago by anonymous

  • Summary changed from [per-object-permissions] pop admin broken to [patch] [per-object-permissions] pop admin broken

I have no idea if this is the right fix or not, but it appears to 'work' as far as I can tell.

comment:2 Changed 8 years ago by anonymous

  • Owner changed from adrian to clong

comment:3 Changed 8 years ago by clong

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

(In [3731]) [per-object-permissions] Fixes #2664 and #2663

comment:4 Changed 8 years ago by clong

More my fault for not properly testing the code, learned my lesson that no matter how simple the fix seems it can still break countless things.

Changed it now so it uses the returnKey method which removes the problem and removes the chance of this happening in the future.

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.