Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#2325 closed defect (fixed)

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

Reported by: mir@… Owned by: adrian
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 9 years ago.
patch to support new-style classes

Download all attachments as: .zip

Change History (4)

Changed 9 years ago by jkocherhans

patch to support new-style classes

comment:1 Changed 9 years ago by jkocherhans

  • Summary changed from authentication framework should work with new style classes as backend. to [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 9 years ago by mtredinnick

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 9 years ago by mtredinnick

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

(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