Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9025671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T06:19:51+00:00 2026-06-16T06:19:51+00:00

Upon saving my user at registration I receive the error message below. Could someone

  • 0

Upon saving my user at registration I receive the error message below. Could someone explain why?

Thanks

Error Message

IntegrityError at /member/registration/
(1048, "Column 'user_id' cannot be null")
Exception Type: IntegrityError at /member/registration/
Exception Value: (1048, "Column 'user_id' cannot be null")

view.py

 if form.is_valid():
            # If form has passed all validation checks then continue to save member.
            user = User.objects.create_user(
                                            username=form.cleaned_data['username'],
                                            email=form.cleaned_data['email'], 
                                            password=form.cleaned_data['password']
                                            )
            user.save()
            #member = User.get_profile()
            #member.name = form.cleaned_data['name']
            #member.save()
            member = Member(
                            name=form.cleaned_data['name']
                            )
            member.save()

models.py

class Member (models.Model):
    user =  models.OneToOneField(User)
    name = models.CharField(max_length=100)

    def __unicode__(self):
        return self.name
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T06:19:52+00:00Added an answer on June 16, 2026 at 6:19 am

    The error is when you’re saving the member, not the user. When creating the member, you are not assigning the user.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Upon successful login, I'm saving the session variable. When the user goes to different
I'm trying to save the name of a Facebook user upon saving that user,
I followed along with this tutorial ( http://www.bit-101.com/blog/?p=1861 ) and noticed that upon saving
Upon user login I check their roles. If they have no roles I want
Upon submit I am trying to have quiz hide and have thanks be shown.
Upon a certain user action, I wish to add to my UIViewController another UIView
I'm trying to store user input in to my sql table as seen below,
I have an ActiveRecord model (I'm on rails 2.3.8) called user and I'm saving
I have a JTree in which the user can drag/drop or re-arrange nodes, upon
If I receive user input, does it make any difference if I validate first

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.