Django

Code

Ticket #2663 (closed: fixed)

Opened 2 years ago

Last modified 2 years ago

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

Reported by: Joeboy Assigned to: clong
Milestone: Component: django.contrib.admin
Version: Keywords: per-object-permissions, row-level
Cc: django25@joebutton.co.uk Triage Stage: Unreviewed
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

pop-admin-fix.patch (1.0 kB) - added by Joeboy on 09/06/06 12:57:45.

Change History

09/06/06 12:57:45 changed by Joeboy

  • attachment pop-admin-fix.patch added.

09/06/06 13:00:06 changed 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.

09/06/06 15:38:28 changed by anonymous

  • owner changed from adrian to clong.

09/06/06 20:28:37 changed by clong

  • status changed from new to closed.
  • resolution set to fixed.

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

09/06/06 20:30:11 changed 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/Change #2663 ([patch] [per-object-permissions] pop admin broken)




Change Properties
Action