Python Django: "Post.author" must be a "User" instance
<p>When I try to assign an author, or user to a Post, Django spews out the following error:</p>

<pre><code>Cannot assign "&lt;User: henrydavidzhu&gt;": "Post.author" must be a "User" instance.
</code></pre>

<p>Here is my views.py:</p>

<pre><code>user_passes_test(lambda u: u.is_authenticated)
def add_post(request):
    form = PostForm(request.POST or None)

    print("User: " + str(request.user))

    if form.is_valid() and request.user.is_authenticated():
        post = form.save(commit=False)
        post.author = request.user
        post.save()
        return redirect(post)
    else:
        print(form.errors)

    return render_to_response('webapp/startthread.html', 
                              { 'form': form },
                              context_instance=RequestContext(request))
</code></pre>

<p>And here is my forms.py:</p>

<pre><code>class PostForm(forms.ModelForm):
    CHOICES = (
        ('Hardware and OS', '&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Desktops'),
    )
    field = forms.ChoiceField(choices=CHOICES)

    class Meta:
        model = Post
        exclude = ['author', 'slug']
</code></pre>

<p>And here is my models.py:</p>

<pre><code>class Post(models.Model):
    title = models.CharField(max_length=500)
    slug = models.SlugField(unique=True)
    text = models.TextField()
    created_on = models.DateTimeField(auto_now_add=True)
    author = models.ForeignKey(User, unique=True)

    def __unicode__(self):
        return self.title

    @models.permalink
    def get_absolute_url(self):
        return ('blog_post_detail', (), 
                {
                    'slug' :self.slug,
                })

    def save(self, *args, **kwargs):
        if not self.slug:
            self.slug = slugify(self.title)
        super(Post, self).save(*args, **kwargs)
</code></pre>