Нулевое значение в столбце "user_id" отношения "authentication_junioruser" нарушает ограничение not-null
Я пытаюсь выполнить POST запрос и получаю ошибку: IntegrityError at /accounts/juniorprofile/. нулевое значение в столбце "user_id" отношения "authentication_junioruser" нарушает ограничение not-null ПОДРОБНАЯ ИНФОРМАЦИЯ: Неудачная строка содержит (14, Ms K, Vadim, t, 99999999, , null, , 2022-10-23, , DevOps, , , set(), , null, null).
Младший пользователь наследуется от пользовательской модели User
class ListCreateUserProfile(generics.ListCreateAPIView):
queryset = JuniorUser.objects.all()
serializer_class = JuniorProfileSerializer
views.py
class JuniorProfileSerializer(serializers.ModelSerializer):
location = LocationSerializer(read_only=True, many=True)
language = serializers.MultipleChoiceField(choices=LANGUAGE)
work_experience = ExperienceSerializer(read_only=True, many=True)
education = EducationSerializer(read_only=True, many=True)
course = CourseSerializer(read_only=True, many=True)
class Meta:
model = JuniorUser
fields = ['id', 'terms_is_accepted', 'first_name', 'last_name',
'phone_number', 'telegram_nick', 'linkedin', 'location',
'profile_photo', 'date_of_birth', 'specialization', 'hard_skills',
'soft_skills', 'language', 'work_experience', 'education',
'course', 'other_info', 'portfolio_link']
serializers.py
class JuniorUser(models.Model):
"""
This model points to an instance of User model and expands that one to determine the role of Junior User.
All the class attributes was got from the technical requirements 'Registration form'
"""
user = models.OneToOneField(User, on_delete=models.CASCADE, related_name="junior")
first_name = models.CharField(max_length=50, blank=False)
last_name = models.CharField(max_length=50, blank=False)
...
def __str__(self):
return str(self.user) if self.user else ''
models.py
Могли бы вы поделиться всеми полями модели JuniorUser?