title: 'NoneType' object has no attribute 'username' on a project which has been working fine for some time
body: <p>I am working on a project and the models seemed to work fine until I added a feedback field in models. The data in the UserProfile table cannot be accessed and returns the above error.</p>
  
  <p>models.py</p>
  
  <pre><code>Roles = (
  ('sales', 'SALES'),
  ('operations', 'OPERATIONS'),
  ('cashier', 'CASHIER'),
  ('frontdesk', 'FRONTDESK'),
  ('client', 'CLIENT'),
  </code></pre>
  
  <p>)</p>
  
  <pre><code>class UserProfile(models.Model):
  user = models.OneToOneField(User,on_delete=models.CASCADE, default=None, null=True)
  role = models.CharField(max_length=50, choices=Roles, default='client')
  feedback = models.TextField(default=None, null=True)
  
  def __str__(self):
      return self.user.username
  </code></pre>
  
  <p>view for feedback:</p>
  
  <pre><code>@login_required
  def feedback(request):
  form = FeedbackForm()
  
  if request.method =='POST':
  
      form = FeedbackForm(request.POST)
      if form.is_valid():
          form = FeedbackForm.save()
  return render(request, 'NewApp/feedback.html',{'form':form})
  </code></pre>
  
  <p>forms.py</p>
  
  <pre><code>class UserForm(forms.ModelForm):
      password = forms.CharField(widget=forms.PasswordInput())
      confirm_password = forms.CharField(widget=forms.PasswordInput())
      class Meta():
          model = User
          fields =   ('first_name','last_name','username','email','password')
  
      def clean(self):
          cleaned_data = super(UserForm, self).clean()
          password = cleaned_data.get("password")
          confirm_password = cleaned_data.get("confirm_password")
  
          if password != confirm_password:
              raise forms.ValidationError(
                  "password and confirm_password does not match"
              )
  
  
  class UserProfileInfoForm(forms.ModelForm):
  
      class Meta():
          model = UserProfile
          fields = ('role',)
  
  class FeedbackForm(forms.ModelForm):
      class Meta():
          model = UserProfile 
          fields = ('feedback',)
  </code></pre>