cloud-gov / django-uaa

A cloud.gov UAA authentication backend for Django
http://cg-django-uaa.readthedocs.io/
Other
3 stars 5 forks source link

Tweak and document user auto-creation policy #33

Closed toolness closed 7 years ago

toolness commented 7 years ago

@stvnrlly this is a PR against your #31 that slightly refactors things and ensures the documentation for the new methods shows up in the sphinx docs.

In particular, it changes get_user_by_email from a staticmethod to a classmethod. This is important because it's now calling other sub-methods, all of which we want to make overrideable. As a classmethod, this method can call sub-methods off cls, which allows subclasses that override those sub-methods to "just work". In contrast, as a staticmethod we have to hard-code UaaBackend when calling sub-methods, which would mean that any subclasses overriding those sub-methods would also have to trivially override get_user_by_email to call their subclass specifically, which is really annoying.

toolness commented 7 years ago

Woot thanks!