Fix the @requires_user_profile on Python 3.

Review Request #9733 — Created March 4, 2018 and submitted — Latest diff uploaded

Information

Djblets
release-2.0.x
b36638e...

Reviewers

The @requires_user_profile decorator only worked with unbound methods
on Python 2.x, but the concept of an unbound method is very different on
Python 3.x. Instead of being a MethodType, it's just a standard
function, meaning we can't check im_func/__func__, but rather we
need to check the function itself.

This change updates the decorator to perform the appropriate checks on
both Python 2.x and 3.x.

Unit tests using this decorator pass on Python 2.7, 3.4, 3.5, and 3.6.

    Loading...