ryan-roemer / django-cloud-browser

Django application browser for cloud datastores (Rackspace, AWS, etc.).
http://ryan-roemer.github.com/django-cloud-browser/
MIT License
81 stars 27 forks source link

Fix exception translation #19

Closed c-w closed 5 years ago

c-w commented 5 years ago

I've seen behavior where the second or third initialization of the exception translation wrapper doesn't correctly dereference the lazy_translations in __new__ which leads to some exceptions not being translated and therefore HTTP 500 errors coming through to the user.

This pull request makes the wrapper more reliable by removing the need for __new__ and simplifying the code to dereference the lazy_translations only at usage time.