mirror of
https://git.v0id.ovh/n3wt-innov/n3wt-school.git
synced 2026-01-29 07:53:23 +00:00
feat: Gestion de la création d'un nouveau guardian, de l'association
avec un guardian dumême établissement, et de l'association avec un guardian d'un autre établissement
This commit is contained in:
@ -110,6 +110,9 @@ class StudentSerializer(serializers.ModelSerializer):
|
||||
profile_role = guardian_data.pop('profile_role', None)
|
||||
|
||||
if profile_role_data:
|
||||
# Vérifiez si 'profile' est un objet ou une clé primaire
|
||||
if isinstance(profile_role_data.get('profile'), Profile):
|
||||
profile_role_data['profile'] = profile_role_data['profile'].id
|
||||
establishment_id = profile_role_data.pop('establishment').id
|
||||
profile_role_data['establishment'] = establishment_id
|
||||
|
||||
|
||||
Reference in New Issue
Block a user