I ran into some very confusing errors when setting the FOO_EXTRA_DATA variable in settings.py. First, there's a bug if you set
FOO_EXTRA_DATA = [
('user',)
]
Since the unpacking is faulty: name = alias = entry when it should instead be (name,) = (alias,) = entry.
Secondly, certain configuration errors result in a TypeError being thrown — which is unfortunately swallowed by Django's auth module. I re-worked the whole logic so that it's more thorough, and always gives visible exceptions — by instead throwing a BackendException that I introduced.
Also, I made the following work:
FOO_EXTRA_DATA = [ 'user' ]
Note: FOO goes for any backend, in my case I used the Instagram one.
I ran into some very confusing errors when setting the
FOO_EXTRA_DATA
variable insettings.py
. First, there's a bug if you setSince the unpacking is faulty:
name = alias = entry
when it should instead be(name,) = (alias,) = entry
.Secondly, certain configuration errors result in a
TypeError
being thrown — which is unfortunately swallowed by Django's auth module. I re-worked the whole logic so that it's more thorough, and always gives visible exceptions — by instead throwing aBackendException
that I introduced.Also, I made the following work:
Note:
FOO
goes for any backend, in my case I used the Instagram one.