diff --git a/core/serializers.py b/core/serializers.py index 6a2039e..0121405 100644 --- a/core/serializers.py +++ b/core/serializers.py @@ -85,7 +85,7 @@ class UpdateUserSerializer(serializers.ModelSerializer): class Meta: model = models.CustomUser - fields = ('full_name', 'email') + fields = ('full_name', 'email', 'notify') def validate_email(self, value): user = self.context['request'].user diff --git a/core/tests.py b/core/tests.py index 1410b3f..6144a64 100644 --- a/core/tests.py +++ b/core/tests.py @@ -169,7 +169,6 @@ class CustomUserViewSetTest(APITestCase): data = { "email": "new_email@mail.com", "full_name": "New Full Name", - 'provider': 'PROVIDER', 'notify': True, } @@ -183,6 +182,10 @@ class CustomUserViewSetTest(APITestCase): # Assert forbidden code self.assertEqual(response.status_code, status.HTTP_200_OK) + # Assert instance has been modified + for key in data: + self.assertEqual(data[key], response.data[key]) + # admin user def test_admin_user_can_create_instance(self): """Admin user can create new instance diff --git a/products/views.py b/products/views.py index c756044..d1eb045 100644 --- a/products/views.py +++ b/products/views.py @@ -75,6 +75,7 @@ class MyProductsViewSet(viewsets.ModelViewSet): return self.model.objects.filter(company=self.request.user.company).order_by('-created') + class AdminProductsViewSet(viewsets.ModelViewSet): """ Allows user with role 'SITE_ADMIN' to access all product instances """ diff --git a/static/.gitignore b/static/.gitignore new file mode 100644 index 0000000..c96a04f --- /dev/null +++ b/static/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file