title: 'User' object has no attribute 'get' with formset (passing user to get a queryset)
body: <p>I am trying to display a formset for a particular User.</p>
  
  <p>If the user is on the 'medical tab', then it should display a tiny form (a checkbox and a text box) for each dependent of the user.</p>
  
  <p>In my <code>views.py</code> I have this:</p>
  
  <pre><code>def get_dep_form(benefit_tab, user):
      if benefit_tab == 'medical':
          DepMedFormSet = formset_factory(DependentMedicalBenefitForm)
          link_formset =  DepMedFormSet(user)
      else:
          return None
      return link_formset
  </code></pre>
  
  <p>In my <code>forms.py</code> I have this:</p>
  
  <pre><code>class DependentMedicalBenefitForm(forms.ModelForm):
      has_medical = forms.BooleanField()
      med_group_id = forms.CharField(max_length=10)
      class Meta:
          model = Dependent
          fields = [
              'has_medical', 'med_group_id'
          ]
  
      def __init__(self, *args, **kwargs):
          self.user = kwargs.pop('user')
          queryset = Dependent.objects.filter(employee=self.user)
          super(DependentMedicalBenefitForm, self).__init__(*args, **kwargs)
          self.fields['has_medical'].queryset = queryset
          self.fields['med_group_id'].queryset = queryset
  </code></pre>
  
  <p>In my <code>views.py</code> I'm getting the form like this:</p>
  
  <pre><code>def index(request, benefit_tab=None):
       #stuff
       if benefit_tab:
            link_formset = get_dep_form(benefit_tab, request.user)
  return render(request, 'benefits/index.html', {
       #stuff
       'link_formset': link_formset,
  })
  </code></pre>
  
  <p>I am running into the error: <code>'User' object has no attribute 'get'</code></p>
  
  <p>If I don't pass a user, and comment out the <strong>init</strong> function, then it displays a single checkbox and textbox as expected - but I can't figure out why passing the user this way is not working.</p>
  
  <p>Bonus points: if you know how to prepopulate the formset with the respective data - that is next up once I get past the 'User' error.</p>