Opened 10 years ago

Last modified 10 years ago

#24097 closed Bug

Python3 AttributeError with redirect_to_login and lazy LOGIN_URL — at Version 1

Reported by: Peter Schmidt Owned by: nobody
Component: contrib.auth Version: 1.7
Severity: Release blocker Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Peter Schmidt)

See discussion on #18776 to decide whether to keep patching symptoms or fix the root cause.

Ran into the same AttributeError: '__proxy__' object has no attribute 'decode'.

Please see attached test_redirect_to_login.diff or https://github.com/mathspace/django/compare/error-lazylogin-master which passes under Python 2.7 but throws the AttributeError under Python 3.4

One workaround is to explicitly pass the string form of the variable, i.e.

redirect_to_login(next=..., login_url=str(settings.LOGIN_URL))

Change History (2)

by Peter Schmidt, 10 years ago

Attachment: test_redirect_to_login.diff added

comment:1 by Peter Schmidt, 10 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top