flake8
passed.
JSHint
passed.
Review Request #9733 — Created March 4, 2018 and submitted
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 aMethodType
, it's just a standard
function, meaning we can't checkim_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.