fix bug 923; fix bug 940
[osm/LW-UI.git] / authosm / backend.py
index 9c316a9..f71eddd 100644 (file)
@@ -21,6 +21,7 @@ from .exceptions import OSMAuthException
 
 
 class OsmBackend(object):
+
     def authenticate(self, **kwargs):
         '''
         kwargs will receive the python dict that may contain
@@ -42,6 +43,7 @@ class OsmBackend(object):
                     user.psw = password
                     user.token = result['data']['id']
                     user.project_id = result['data']['project_id']
+                    user.project_name = result['data']['project_name']
                     user.token_expires = result['data']['expires']
                     user.is_admin = bool(result['data']['admin'])
                     user.save()
@@ -60,3 +62,4 @@ class OsmBackend(object):
             return OsmUser.objects.get(pk=user_id)
         except OsmUser.DoesNotExist:
             return None
+