diff --git a/{{cookiecutter.github_repository_name}}/{{cookiecutter.app_name}}/users/permissions.py b/{{cookiecutter.github_repository_name}}/{{cookiecutter.app_name}}/users/permissions.py index e08cf6e5..04dce0cc 100644 --- a/{{cookiecutter.github_repository_name}}/{{cookiecutter.app_name}}/users/permissions.py +++ b/{{cookiecutter.github_repository_name}}/{{cookiecutter.app_name}}/users/permissions.py @@ -11,7 +11,7 @@ def has_object_permission(self, request, view, obj): user_is_making_new_account = view.action == 'create' if user_is_making_new_account: return True - + is_read_only_action = request.method in permissions.SAFE_METHODS if is_read_only_action: return True diff --git a/{{cookiecutter.github_repository_name}}/{{cookiecutter.app_name}}/users/test/test_serializers.py b/{{cookiecutter.github_repository_name}}/{{cookiecutter.app_name}}/users/test/test_serializers.py index d9a0f6e2..d0c15a57 100644 --- a/{{cookiecutter.github_repository_name}}/{{cookiecutter.app_name}}/users/test/test_serializers.py +++ b/{{cookiecutter.github_repository_name}}/{{cookiecutter.app_name}}/users/test/test_serializers.py @@ -12,7 +12,7 @@ def setUp(self): def test_serializer_with_empty_data(self): serializer = CreateUserSerializer(data={}) - assert serializer.is_valid() == False + assert serializer.is_valid() is False def test_serializer_with_valid_data(self): serializer = CreateUserSerializer(data=self.user_data)