From e8891ec49ba48f5cf462f6d693db74bbcc16a411 Mon Sep 17 00:00:00 2001 From: Andrew Conti Date: Fri, 30 Aug 2024 15:49:40 -0400 Subject: [PATCH] wip --- .../{{cookiecutter.app_name}}/users/permissions.py | 2 +- .../{{cookiecutter.app_name}}/users/test/test_serializers.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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)