In my implementation of ModelForm, I would like to perform different types of validation checks based on whether current user is superuser. How can I access the current request user?
In my implementation of ModelForm, I would like to perform different types of validation
Share
you can pass the user object as an extra argument in the form constructor.
e.g.
and the constructor will look like:
and then use user in the clean_XX forms as you wish