caxap / rest_condition

Complex permissions flow for django-rest-framework (http://django-rest-framework.org).
MIT License
279 stars 29 forks source link

using rest framework's IsAuthenticated break the condition evaluation in django 1.10 #9

Closed rouk1 closed 7 years ago

rouk1 commented 8 years ago

If you use rest_framework.permissions.IsAuthenticated the reduce operator will crash here because Django now returns a CallableBool.

This could be fixed by adding a callable test just after getting the result.

        if hasattr(result, '__call__'):
            result = result()
caxap commented 7 years ago

Fixed in v1.0.3 https://github.com/caxap/rest_condition/commit/ce2ced84f67dbb9b371a36311006723a749e1e8f