Signals
create_user_profile(sender, instance, created, **kwargs)
Creates or updates a user profile when a User object is saved.
This signal handler automatically creates a Profile object for newly created User instances, or updates existing Profile objects for existing users. The Profile model can be customized via settings.PROFILE_MODEL.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sender
|
The model class that sent the signal (User). |
required | |
instance
|
The actual instance of the User model being saved. |
required | |
created
|
bool
|
True if a new record was created, False for updates. |
required |
**kwargs
|
Additional keyword arguments passed by the signal. |
{}
|
Returns:
Type | Description |
---|---|
None |
Note
The Profile model is determined by settings.PROFILE_MODEL, defaulting to 'django_util.Profile' if not specified.
Source code in django_util/signals.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
|