title: Register form always give error " this field is required "
body: <p>I want to make a register form, that contains user form and user profile form</p>
  
  <p>my table user is from Django auth_user so it will contain primary column like id, user, email, password, started date, etc</p>
  
  <p>and I have user profile form, that creates from forms.py and the model from model.py here, it has FK user_id which connected to ID in auth_user </p>
  
  <p>the problem is, when I insert the data,  it always said this field required, even though I already insert all the column</p>
  
  <p>here's the code</p>
  
  <p>forms.py</p>
  
  <pre><code>class UserForm(forms.ModelForm):
      password = forms.CharField(widget=forms.PasswordInput(attrs={'class': 'form-control'}))
      username = forms.CharField(widget=forms.TextInput(attrs={'class': 'form-control'}))
      email = forms.CharField(widget=forms.EmailInput(attrs={'class': 'form-control'}))
  
      class Meta():
          model = User
          fields = ('username', 'email', 'password')
  
  
  class UserProfileInfoForm(forms.ModelForm):
      ROLE_1 = 'Business Analyst'
      ROLE_2 = 'Manager'
      ROLE_3 = 'Segment Manager'
      ROLE_4 = 'Admin'
      ROLE_CHOICES = (
          (ROLE_1, u"Business Analyst"),
          (ROLE_2, u"Manager"),
          (ROLE_3, u"Segment Manager"),
          (ROLE_4, u"Admin")
      )
      role = forms.ChoiceField(choices=ROLE_CHOICES, widget=forms.Select(attrs={'class': 'form-control'}))
      description = forms.CharField(widget=forms.Textarea(attrs={'class': 'form-control'}))
      address = forms.CharField(widget=forms.TextInput(attrs={'class': 'form-control'}))
      phone = forms.CharField(widget=forms.TextInput(attrs={'class': 'form-control'}))
      cell = forms.CharField(widget=forms.TextInput(attrs={'class': 'form-control'}))
  
      def __init__(self, disable_fields=True, *args, **kwargs):
          super().__init__(*args, **kwargs)
          if disable_fields:
              self.fields['role'].disabled = True
  </code></pre>
  
  <p>models.py</p>
  
  <pre><code>class UserProfileInfo(models.Model):
      user = models.OneToOneField(User, on_delete=models.CASCADE, related_name='profile')
      role = models.CharField(max_length=250, blank=True)
      description = models.TextField(max_length=250, blank=True)
      address = models.CharField(max_length=250, blank=True)
      phone = models.CharField(max_length=250, blank=True)
      cell = models.CharField(max_length=250, blank=True)
      profile_pic = models.ImageField(upload_to='profile_pics', blank=True)
  
      def __str__(self):
          return self.user.username
  
  </code></pre>
  
  <pre><code>def register(request):
      registered = False
      if request.method == 'POST':
          print("test")
          user_form = UserForm(request.POST)
          profile_form = UserProfileInfoForm(request.POST)
          if user_form.is_valid() and profile_form.is_valid():
              user = user_form.save()
              user.set_password(user.password)
              user.save()
              profile = profile_form.save(commit=false)
              profile.user = user
              if 'profile_pic' in request.FILES:
                  profile.profile_pic = request.FILES['profile_pic']
              profile.save()
              registered = True
          else:
              print(user_form.errors, profile_form.errors)
      else:
          user_form = UserForm()
          profile_form = UserProfileInfoForm(disable_fields=False)
      return render(request, 'register.html',
                    {'user_form': user_form,
                     'profile_form': profile_form,
                     'registered': registered})
  </code></pre>
  
  <p>html</p>
  
  <pre><code>&lt;section id="main-content"&gt;
        &lt;section class="wrapper"&gt;
          &lt;h3&gt;&lt;i class="fa fa-angle-right"&gt;&lt;/i&gt;Register User&lt;/h3&gt;
          &lt;!-- row --&gt;
          &lt;!-- FORM VALIDATION --&gt;
          &lt;div class="row mt"&gt;
            &lt;div class="col-lg-12"&gt;
              &lt;div class="form-panel"&gt;
                &lt;div class=" form"&gt;
                   {% load staticfiles %}
                            {% block body_block %}
  
                                  {% if registered %}
                                    &lt;h1&gt;Thank you for registering!&lt;/h1&gt;
                                  {% else %}
  
  
  
  
  
                      &lt;form class=" form-horizontal style-form" id="commentForm" enctype="multipart/form-data" method="POST" action=""&gt;
  
                                      {% csrf_token %}
  
                                      {{ user_form.as_p}}
  
                                      {{ profile_form.as_p }}
  
  
  
                      &lt;button class="btn btn-theme" type="submit" style="height:50px;width:200px;" value="Register"&gt;Register&lt;/button&gt; 
  
  
                       &lt;/form&gt;
  
                   {% endif %}
                                &lt;/div&gt;
                              &lt;/div&gt;
                            {% endblock %}
                &lt;/div&gt;
              &lt;/div&gt;
              &lt;!-- /form-panel --&gt;
            &lt;/div&gt;
            &lt;!-- /col-lg-12 --&gt;
          &lt;/div&gt;
          &lt;!-- /row --&gt;
        &lt;/section&gt;
      &lt;/section&gt;
  </code></pre>
  
  <p>can someone help me? i already try some way like remove the profile_form.isvalid() in the if condition, and it goes to the next step, but it is error <code>ORA-01400: cannot insert NULL into ("ICB"."POLLS_USERPROFILEINFO"."USER_ID")</code> which user_id is the fk </p>
  
  <p>at first .. I make this module and it works fine, but 1 month later it errors, and I didn't change any code</p>