Skip to content

i got this error messages when attempting to make a post, please i need help. thanks #99

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Lemmy4christ opened this issue Mar 25, 2020 · 0 comments

Comments

@Lemmy4christ
Copy link

ValueError at /post/new/
Cannot assign "<SimpleLazyObject: <django.contrib.auth.models.AnonymousUser object at 0x04CF38E0>>": "post.author" must be a "User" instance.

def form_valid(self, form):
form.instance.author = self.request.user
return super().form_valid(form)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant