re: Django inline formsets with Class-based views and crispy forms VIEW POST

FULL DISCUSSION
 

Haiiii,

I got some bug in this code.please help me to find out.The bug is

ValueError: Cannot assign ">": "Collection.created_by" must be a "User" instance.

 

Hey elisa,

I think you have to call localhost:8000/admin and log in as user "admin" and password "admin". If you take a look into the classes CollectionCreate or CollectionUpdate inside views.py then you can see that the created_by field is always set to the user who executed the request. And the variable request.user is only set, if a user is logged in.

Hope that will help you to get the demo running ;-)
Best regards,
andi

code of conduct - report abuse