1👍
✅
Firstly, the error isn’t anything to do with your custom clean method, it is happening in the view.
It is simply that you should use square brackets to access dict items, not parentheses:
unm=form.cleaned_data['username']
Source:stackexchange.com