title: Django ImageField is not being updated while submiting a form
body: <h1>Issue describrion</h1>
  <p>I have a model which describes a UserProfile and a dedicated form to allow user to update the model. Except <code>photo</code>(ImageField), everything is working fine. Issue with <code>photo</code> field is that the image is not being changed at all with <code>EditProfileForm</code>. In other words I have same image attached to this field before and after form submition, the <code>photo</code> is pointing to the same picture, and nothing new was uploaded to the server.
  It is worth to be noted that <code>photo</code> field is working through the form from admin panel.
  No issues with other fields related to <code>UserProfile</code> and <code>User</code>: all of them can be updated, and the update is saved in database.</p>
  <h1>Environment details</h1>
  <p>For a time being I am using Django in version 4.0.3 running with <code>DEBUG=True</code> and build in development server.</p>
  <h1>Code</h1>
  <pre><code>### Models
  def get_image_save_path(
          instance,
          filename:str
          ) -&gt; str:
      save_dir = instance.__class__.__name__
      file_name = uuid.uuid4().hex
      file_extension = pathlib.Path(filename).suffix
      return f&quot;{save_dir}/{file_name}{file_extension}&quot;.lower()
  
  def validate_image_size(image):
      if not image:
          raise ValidationError(&quot;No image found&quot;)
      if image.size &gt; 512*1024:
          raise ValidationError(&quot;Max size is 512kb&quot;)
  
  class UserProfile(models.Model):
      user = models.OneToOneField(User,
                                  on_delete=models.CASCADE,
                                  related_name='user_profile',
                                  primary_key=True)
      photo = models.ImageField(upload_to=get_image_save_path,
                                      verbose_name=&quot;Photo&quot;, 
                                      validators=[validate_image_size],
                                      default=&quot;userprofile/default_photo.jpg&quot;,
                                      null=False,
                                      blank=False)
      bio = models.TextField(default='', blank=True)
  
      def __str__(self):
          return f&quot;{self.user.username}&quot;
  
  @receiver(post_save, sender=User)
  def create_user_profile(
          sender:ModelBase,
          instance:User,
          created:bool,
          **kwargs:Dict) -&gt; None:
      if created:
          UserProfile.objects.create(user=instance)
      else:
          return
  
  @receiver(post_save, sender=User)
  def save_user_profile(
      sender: ModelBase,
      instance: User,
      **kwargs: Dict) -&gt; None:
      instance.user_profile.save()
  </code></pre>
  <pre><code>### Forms
  class EditUserForm(ModelForm):
      class Meta:
          model = User
          fields = ('first_name', 'last_name', 'email')
  
  class EditProfileForm(ModelForm):
      photo = ImageField(widget=FileInput(attrs={'class': 'form-control-file'}))
      class Meta:
          model = UserProfile
          fields = ('photo', 'bio')
  </code></pre>
  <pre><code>### Views
  @login_required
  def profile_view(request):
      return render(request, 
                      template_name=&quot;accounts/profile_view.html&quot;,
                      context = {})
  
  @login_required
  def profile_edit(request):
      if request.method == 'POST':
          userForm = EditUserForm(data=request.POST, instance=request.user)
          profileForm = EditProfileForm(data=request.POST, 
                                        files=request.FILES, 
                                        instance=request.user.user_profile)
          if userForm.is_valid() and profileForm.is_valid():
              profileForm.save()
              userForm.save()
              return redirect('accounts_app:profile_view')
      else:
          userForm = EditUserForm(instance=request.user)
          profileForm = EditProfileForm(instance=request.user.user_profile)
          context = {&quot;userForm&quot;: userForm, &quot;profileForm&quot;: profileForm, }
          return render(request, 'accounts/edit_profile.html', context)
  </code></pre>
  <pre><code>### Template
  {% block content %}
  &lt;div class=&quot;row&quot;&gt;
    &lt;div class=&quot;panel panel-primary panel-login rounded-lg&quot;&gt;
      &lt;div class=&quot;panel-body&quot;&gt;
        &lt;form class=&quot;&quot; action=&quot;&quot; method=&quot;POST&quot;&gt;
          {% csrf_token %}
          {% for field in userForm %}
          &lt;p&gt;
            {{ field.label_tag }}&lt;br&gt;
            {{ field }}
            {% if field.help_text %}
              &lt;small style=&quot;color: grey&quot;&gt;{{ field.help_text }}&lt;/small&gt;
            {% endif %}
            {% for error in field.errors %}
              &lt;p style=&quot;color: red&quot;&gt;{{ error }}&lt;/p&gt;
            {% endfor %}
          &lt;/p&gt;
          {% endfor %}
  
          {% for field in profileForm %}
          &lt;p&gt;
            {{ field.label_tag }}&lt;br&gt;
            {{ field }}
            {% if field.help_text %}
              &lt;small style=&quot;color: grey&quot;&gt;{{ field.help_text }}&lt;/small&gt;
            {% endif %}
            {% for error in field.errors %}
              &lt;p style=&quot;color: red&quot;&gt;{{ error }}&lt;/p&gt;
            {% endfor %}
          &lt;/p&gt;
          {% endfor %}
        &lt;button class=&quot;btn btn-danger standard-btn&quot; type=&quot;submit&quot;&gt;Zapisz zmiany&lt;/button&gt;
        &lt;/form&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  {% endblock %}
  </code></pre>
  <h1>Question</h1>
  <p>What I did wrong in the code, that is causing and described issue with <code>photo</code> field?</p>