(contacts) add notes & force full_name

We make the full name mandatory and add a field to
allow user to store personnal notes on the contact.

This also make the "base" contact not mandatory because
user may want to create new contacts out of the blue.
This commit is contained in:
Quentin BEY
2024-11-28 10:55:44 +01:00
committed by BEY Quentin
parent 6d5d0f7ebb
commit 625f122ad5
6 changed files with 93 additions and 13 deletions

View File

@@ -17,10 +17,14 @@ class ContactSerializer(serializers.ModelSerializer):
"base",
"data",
"full_name",
"notes",
"owner",
"short_name",
]
read_only_fields = ["id", "owner"]
extra_kwargs = {
"base": {"required": False},
}
def update(self, instance, validated_data):
"""Make "base" field readonly but only for update/patch."""