title: Instance of 'OneToOneField' has no 'username' member
body: <p>I got the following error when I created Profile model</p>
  
  <blockquote>
    <p>Instance of 'OneToOneField' has no 'username' member</p>
  </blockquote>
  
  <p>This is the snippet of the code I created </p>
  
  <pre><code>from django.db import models
  from django.contrib.auth.models import User
  class Profile(models.Model):
      user = models.OneToOneField(User, on_delete=models.CASCADE)
      image = models.ImageField(default="default.jpg", upload_to="profile_pics")
  
      def __str__(self):
          return f"{self.user.username} Profile"
  </code></pre>
  
  <p>previously it was working fine. Now, all of a sudden I am getting this error.I didn't understand the meaning of this error.  How do I solve it? 
  Thank you</p>