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 8152787
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T15:49:03+00:00 2026-06-06T15:49:03+00:00

I am having problem saving additional information about each user automatically when a new

  • 0

I am having problem saving additional information about each user automatically when a new user signs-up. I have created a profile for User model extension to save additional data about my users. However, when the signal handler gets called at post_save, the data stored in the request is not passed to the signal_handler.

The following is the profile that I have created.

class StudentProfile(models.Model):

    user = models.ForeignKey(User, unique=True)

    # Other information about the Student
    city = models.CharField(max_length=25)
    country = models.CharField(max_length=25)
    student_age = models.IntegerField(max_length=3)

In my signup view I call form.save() function in which the User object gets created and a new row is added in the data base.

def save(self, new_data):
    u = User.objects.create_user( new_data['username'],
                                new_data['email'],
                                new_data['password'])
    return u

After that, the post_save signal is called and the signal handler tries to create a new profile:

def create_student_profile(sender, instance, created, **kwargs):
    if created:
        StudentProfile.objects.create(user=instance)

post_save.connect(create_student_profile, sender=User)

At this point, I get the following error in the broswer:

IntegrityError at /signup/
(1048, “Column ‘student_age’ cannot be null”)

I looked at the call stack and found that the SQL query that is being executed has None value for Student_age and nothing for country and city.

sql u’INSERT INTO student_studentprofile (user_id, city, country, student_age) VALUES (17, , , None)’

How can I pass the request parameters such as student_age, country and city to this signal handler? Do I have to manually save this information?

I have thoroughly searched for the answer of this question on stackOverflow and Google and I have come rather empty handed.

Thanks for your help.

  • 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-06T15:49:04+00:00Added an answer on June 6, 2026 at 3:49 pm

    Yep, unfortunately you’ll need to make those fields nullable. Then set them in your view after the user has been saved.

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

Sidebar

Related Questions

I have having a problem saving the sign up form using Devise. I am
Okay, I'm having a problem saving after I've deleted all the objects I have
am having problem in Saving some data in my Java code. I have like
I'm having a problem saving a string file with NSSavePanel after sandboxing the app
Having problem with my application, I seem to be new in ios. My project
I'm having problem with getting location.hostname for newly created window in javascript. For example
I am having a problem saving the Parent object which contains multiple children. The
In this question I was having problem with saving objects that had foreign keys
I'm using Core data on my app ok, i have a problem when saving
I'm having a problem saving/loading an ArrayList<HashMap<String, Object>> across Android versions. I've been searching

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.