diff --git a/junior/views.py b/junior/views.py index cdb8874..5ca50e0 100644 --- a/junior/views.py +++ b/junior/views.py @@ -223,7 +223,10 @@ class AddJuniorAPIView(viewsets.ModelViewSet): junior.guardian_code.append(guardian.guardian_code) else: return "Max" - junior.guardian_code_status.append(str(NUMBER['two'])) + if not junior.guardian_code_status: + junior.guardian_code_status = [str(NUMBER['two'])] + else: + junior.guardian_code_status.append(str(NUMBER['two'])) junior.save() jun_data, created = JuniorGuardianRelationship.objects.get_or_create(guardian=guardian, junior=junior) if jun_data: