Cannot assign "42": "Event.user_id" must be a "User" instance
<p>I have checked all the solutions related to my question but no one worked, i have an event table in which i am assigning the id of user. Event Model is </p>

<pre><code>class Event(models.Model):
    user_id=models.ForeignKey(User, on_delete=models.CASCADE)
    event_auth_id=models.CharField(null=True, max_length=225)
    event_title=models.CharField(max_length=225)
    ticket_title=models.CharField(max_length=225)
    category=models.CharField(max_length=50)
    event_summary=models.TextField()
    event_information=models.TextField()
    restriction=models.CharField(max_length=50, default='No Restriction')
    artist_image=models.CharField(null=True, max_length=50)
    event_poster=models.CharField(null=True, max_length=50)
    notification_email=models.CharField(null=True, max_length=50)
    notification_frequency=models.CharField(null=True, max_length=15)
    name_on_ticket=models.CharField(max_length=225)
    event_tnc=models.TextField()
    current_step=models.IntegerField(null=True)
    event_status=models.BooleanField(default=True)
    created=models.DateTimeField(auto_now=True)
    modified=models.DateTimeField(auto_now_add=True)
</code></pre>

<p>I am assigning the logged in user id from view </p>

<pre><code>def create_new_event(request, steps):
if request.method == 'POST':
    if(steps=="step_1"):
        stepFirstForm = CreateEventStepFirstForm(request.POST)
        if stepFirstForm.is_valid():
            eventStepFirst = Event(
                user_id = request.user.id,
                event_auth_id = uuid4(),
                event_title = request.POST['event_title'],
                ticket_title = request.POST['ticket_title'],
                category = request.POST['categories'],
                event_summary = request.POST['event_summary'],
                event_information = request.POST['event_information'],
                restriction = request.POST['restrictions'],
                notification_email = request.POST['notification_email'],
                notification_frequency = request.POST['email_frequency']
            )
</code></pre>

<p>But its giving me error </p>

<pre><code>Cannot assign "42": "Event.user_id" must be a "User" instance.    
</code></pre>