def can_access ( self , user ) : return self . class_ . is_admin ( user ) or self . is_ready and self . class_ in user . classes
python check if admin privliges
Return whether or not user can access a project .
def can_access(self, user):
        """Return whether or not `user` can access a project.

        The project's is_ready field must be set for a user to access.

        """
        return self.class_.is_admin(user) or \
            self.is_ready and self.class_ in user.classes