Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#2325 closed defect (fixed)

[patch] authentication framework should work with new style classes as backend.

Reported by: mir@… Owned by: Adrian Holovaty
Component: Contrib apps Version:
Severity: major Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

The new Authentication Framework uses str() on the class to get the path of the module:

        user.backend = str(backend.__class__)

First, this does absolutely not work with new style classes as backend, since there str() is different. Second, it's hackish anyway.

I set severity to major since new style classes are pretty normal, the error messages are misleading and pretty hard to debug--took me one full work day.

Attachments (1)

2325.diff (522 bytes) - added by jkocherhans 10 years ago.
patch to support new-style classes

Download all attachments as: .zip

Change History (4)

Changed 10 years ago by jkocherhans

Attachment: 2325.diff added

patch to support new-style classes

comment:1 Changed 10 years ago by jkocherhans

Summary: authentication framework should work with new style classes as backend.[patch] authentication framework should work with new style classes as backend.

I've added a patch that will support both old and new style classes, however it will probably only work for instances. Does anyone care enough about supporting class/static methods or whatever to fix that particular corner case?

comment:2 Changed 10 years ago by Malcolm Tredinnick

Joseph, your patch fixes this bug as given: it is no better or worse than the previous behaviour with respect to static methods and classes. Let's drop this one in and cross the bridge for other sorts of methods when it arises. We can fix that case if/when we need to without breaking backward-compat.

comment:3 Changed 10 years ago by Malcolm Tredinnick

Resolution: fixed
Status: newclosed

(In [3346]) Fixed #2325 -- fix the authentication framework to work with new-style classes.
Patch from Joseph Kocherhans.

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