Pass username to Django form
Pass username to Django form Question: I have a custom Form where I need to pass in the request.user.username so I can use that to fill out forms.ModelChoiceField based on what user is accessing it. Here is what I have views.py if request.method == ‘POST’: form = DepartmentForm(request.POST, username=request.user.username) # Do stuff else: form = …