title: Changing a form field's 'required' property with save_model in Django admin
body: <p>I have tried all the different examples and methods I could find on Stack Overflow for this, and for whatever reason, can't get this to work properly.</p>
  
  <p>So in my admin.py I have a UserForm and and UserAdmin. Based on the condition where a boolean is checked within the form, I want to change the 'required' attribute on a few different form fields to 'false' so I can effectively save. I've used a few different print statements to ascertain that the 'required' is in fact getting changed to false when the condition is met, however, when I try and save, it won't let me as the fields highlight and say they're still required.</p>
  
  <p>It is almost like the save_model doesn't care how I edit the form, that the old form and its 'required' attributes are overriding my changes. Thanks for any help!</p>
  
  <p><strong>admin.py</strong></p>
  
  <pre><code>class UserForm(forms.ModelForm):
      state = forms.CharField(min_length=2, widget=forms.TextInput(attrs={'placeholder':'CA'}))
      zipcode = forms.CharField(max_length=5, min_length=5,)
  
      class Meta:
          model = User
          fields = '__all__'
  
  
  class UserAdmin(admin.ModelAdmin):
      model = Order
      form = UserForm
  
      def save_model(self, request, obj, form, change):
          if obj.pickup_only == 1:
              form.fields['address'].required = False
              form.fields['city'].required = False
              form.fields['state'].required = False
              form.fields['zipcode'].required = False
          return super(UserAdmin, self).save_model(request, obj, form, change)
  </code></pre>
  
  <hr>
  
  <p>revised code for UserForm:</p>
  
  <pre><code>def clean(self):
      cleaned_data = super(UserForm, self).clean()
      address = cleaned_data.get('address')
      state = cleaned_data.get('state')
      city = cleaned_data.get('city')
      zipcode = cleaned_data.get('zipcode')
      pickup_only = cleaned_data.get('pickup_only')
  
      if pickup_only == True:
          # I STUCK IN ADDRESS TO EMPHASIZE THE ERROR IN SCREENSHOT
          self.fields_required(['first_name', 'last_name', 'dob', 'phone', 'email', 'address'])
      else:
          self.cleaned_data['address', 'city', 'state', 'zip code'] = ''
      return self.cleaned_data
  
  def fields_required(self, fields):
      for field in fields:
          print(field)
          # RETURNS: first_name, last_name, dob, phone, email, address
          if not self.cleaned_data.get(field, ''):
              msg = forms.ValidationError("This field is required. Custom.")
              self.add_error(field, msg)
  </code></pre>
  
  <p>When I save I get this:</p>
  
  <p><a href="https://i.stack.imgur.com/aKX66.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aKX66.png" alt="enter image description here"></a></p>