[Django]-Null value in column "user_id" violates not-null constraint in Django 1.9

6👍

It looks like you need to add the following to your TicketCreate class in the form_valid function:

form.instance.user = Profile.objects.get(user=self.request.user)

Let me know if that works!

Leave a comment