Commit d2263896 by Őry Máté

dashboard: save user on first logon

parent 89d77c3b
......@@ -31,6 +31,8 @@ class Profile(Model):
def create_profile(sender, user, request, **kwargs):
if not user.pk:
return False
profile, created = Profile.objects.get_or_create(user=user)
return created
......@@ -50,6 +52,10 @@ if hasattr(settings, 'SAML_ORG_ID_ATTRIBUTE'):
value = None
logger.info("save_org_id couldn't find attribute. %s", unicode(e))
if sender.pk is None:
sender.save()
logger.debug("save_org_id saved user %s", unicode(sender))
profile, created = Profile.objects.get_or_create(user=sender)
if created or profile.org_id != value:
logger.info("org_id of %s added to user %s's profile",
......
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 sign in to comment