2👍
I think what you want instead after you make your user
is this
team = UniservedTeam.objects.create(user=user,Role=['Vendor Co-ordinator'],ContactNumber='862339798167')
0👍
Try this,
team = UniservedTeam.objects.create(user__id=user.id, Role=['Vendor Co-ordinator'],ContactNumber='862339798167')
- [Answered ]-Passing variable to a django queryset
- [Answered ]-Django Rest Framework User and UserRole and Permission Handling using Token Authentication
Source:stackexchange.com