Commit 68a41b98 authored by Michal Čihař's avatar Michal Čihař

Docs

parent 8ba2b28c
...@@ -56,10 +56,12 @@ def create_profile_callback(sender, **kwargs): ...@@ -56,10 +56,12 @@ def create_profile_callback(sender, **kwargs):
Automatically create profile when creating new user. Automatically create profile when creating new user.
''' '''
if kwargs['created']: if kwargs['created']:
# Create profile
profile, newprofile = Profile.objects.get_or_create(user = kwargs['instance']) profile, newprofile = Profile.objects.get_or_create(user = kwargs['instance'])
if newprofile: if newprofile:
profile.save profile.save
# Add user to Users group if it exists
try: try:
group = Group.objects.get(name = 'Users') group = Group.objects.get(name = 'Users')
kwargs['instance'].groups.add(group) kwargs['instance'].groups.add(group)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment