Django EmbeddedModelField saying “This field may not be blank” when doing PUT request despite field having “blank=True”

I'm creating a Django application with django-rest-framework and using djongo to connect to MongoDB. I have nested models as such:

I'm creating a Django application with django-rest-framework and using djongo to connect to MongoDB. I have nested models as such:

class Group(models.Model):
    users = models.ArrayModelField(
        model_container=User
    )

class User(models.Model):
number = models.IntegerField(
default=None,
null=True
)

song = models.EmbeddedModelField(
    model_container=Song,
    null=True,
    blank=True
)

class Meta:
    abstract = True

class Song(models.Model):
mp3_file = models.URLField(
default=None,
blank=True,
null=True
)

comments = models.CharField(
    max_length=250,
    default='',
    blank=True
)

class Meta:
    abstract = True

When a Group is created, the Users and the Songs are created without any problems. For example, when created, the Group may look like:

{
"name": "Sample",
"users: [
{
"number": null,
"song": {
"mp3_file": null,
"comments": ""
}
}
]
}

This all works fine. However, if I try to do a PUT request and don't change the value of "number", "mp3_file", or "comments", I will get the following error message:

"user": [
{
"number": [
"This field may not be null."
],
"song": {
"mp3_file": [
"This field may not be null."
],
"comments": [
"This field may not be blank."
]
}
}
]

Any thoughts on how to fix this error? I am just using a generic RetrieveUpdateDestroyAPIView as the view for this endpoint.

edit: I have also tried recreating all migrations as well as dropping the table and recreating it, and neither of those approaches helped.

edit: Here is the view:

class GroupDetail(generics.RetrieveUpdateDestroyAPIView):
serializer_class = GroupSerializer
queryset = Group.objects.all()
lookup_field = 'group_name'
lookup_url_kwarg = 'group_name'

And the serializers:

class GroupSerializer(serializers.HyperlinkedModelSerializer):
users = UserSerializer(many=True)

def update(self, instance, validated_data):
    if validated_data.get('group_name', None) is not None:
        instance.__setattr__('group_name', validated_data.get('group_name'))

    instance.save()

    return instance

class Meta:
    model = Group
    fields = (
        'group_name',
        'users'
    )

class UserSerializer(serializers.Serializer):
number = serializers.IntegerField()
song = SongSerializer()

class SongSerializer(serializers.Serializer):
mp3_file = serializers.URLField()
comments = serializers.CharField(
max_length=250
)

But part of the issue is that the serializers are never even being reached since the data is validating incorrectly.

Python Django Tutorial | Django Course

Python Django Tutorial | Django Course

🔥Intellipaat Django course: https://intellipaat.com/python-django-training/ 👉This Python Django tutorial will help you learn what is django web development &...

This Python Django tutorial will help you learn what is django web development & application, what is django and introduction to django framework, how to install django and start programming, how to create a django project and how to build django app. There is a short django project as well to master this python django framework.

Why should you watch this Django tutorial?

You can learn Django much faster than any other programming language and this Django tutorial helps you do just that. Our Django tutorial has been created with extensive inputs from the industry so that you can learn Django and apply it for real world scenarios.

Learn MongoDB - MongoDB Tutorial for Beginners - Getting Started with MongoDB - Part 3/3

Learn MongoDB - MongoDB Tutorial for Beginners - Getting Started with MongoDB

What you’ll learn

  • Work with MongoDB with Clarity and Confidence
  • Use 4 tools MongoCHEF, NOSQL Manager, RoboMongo, MongoBooster easily
  • Do Regex, GridFS , Replication , Sharding, Full text search
  • Basic and Advanced CRUD operations using MongoDB
  • Import and Export data from MongoDB
  • Work MapReduce, Embedded Documents,Save&Insert , indexing, capped collections, TTL
  • Bonus section * Use java,C#,PHP,Nodejs to access MongoDB features like CRUD, GridFS
  • Bonus Section * A 50 minutes MongoDB key feature exercises
  • 100+ Quizzes 40+ Activities

Learn More

MongoDB - The Complete Developer’s Guide

The Complete Developers Guide to MongoDB

MongoDB - The Complete Developer’s Guide

Learn MongoDB : Leading NoSQL Database from scratch

Learn NoSQL Databases - Complete MongoDB Bootcamp 2019

Build a CRUD Operation using PHP & MongoBD

MongoDB with Python Crash Course - Tutorial for Beginners

Learn NoSQL Databases from Scratch - Complete MongoDB Bootcamp 2019

AngularJS tutorial for beginners with NodeJS, ExpressJS and MongoDB

MEAN Stack Tutorial MongoDB, ExpressJS, AngularJS and NodeJS

Creating RESTful APIs with NodeJS and MongoDB Tutorial