CenterForOpenScience / SHARE

SHARE is building a free, open, data set about research and scholarly activities across their life cycle.
http://share-research.readthedocs.io/en/latest/index.html
Apache License 2.0
101 stars 58 forks source link

[Fix] Fix 500 error at /userinfo/ endpoint #721

Closed aaxelb closed 7 years ago

aaxelb commented 7 years ago

IDObfuscator.encode used type() to get the model of an instance, which broke on the SimpleLazyObject wrapper Django uses for users. Instead, use instance._meta, which is proxied to the wrapped object, and should work equivalently for all models.