Fixed pep8 errors
check permission in motion view