2 messages · Page 1 of 1 (latest)
I have this create view, and it's creating an object with a foreign key to 2nd object, I want to forbid creation if the sender doesn't have access to 2nd object. Where is the best place to put logic for this? Override create method? During data validation? And most RESTful way to respond to this?
def update(......):
if instance.created_by != request.login_user:
raise errorMessage