Python Forum
MASQUERADE for Django 1.11 - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Web Scraping & Web Development (https://python-forum.io/forum-13.html)
+--- Thread: MASQUERADE for Django 1.11 (/thread-16538.html)



MASQUERADE for Django 1.11 - Saurabh - Mar-04-2019

I am upgrading my Python from 2 to 3 and Django from 1.8 to 1.11.

In the lastest Django release I am unable to use the masquerade feature.
The error I am getting is : 'User' object has no attribute 'is_masked'

The code where this is called is :
def mask(request, uid):
    if not request.user.is_masked and not request.user.is_staff:
        return PermissionDenied()
    elif not request.user.is_superuser and MASQUERADE_REQUIRE_SUPERUSER:
        return PermissionDenied()
If possible kindly help.