Commit 9089e275 authored by 王浩's avatar 王浩

Merge branch 'haow/dev' into 'test'

add roles in login get method

See merge request alpha/sun!184
parents 1fe21a2b 24552ea0
......@@ -75,7 +75,10 @@ class LoginView(APIView):
'avatar': settings.AVATAR
})
if data['is_staff']:
data.update({'roles': ['staff']})
if data.get('staff_level'):
data.update({'roles': ['mbhoperator']})
else:
data.update({'roles': ['staff']})
else:
data.update({'roles': ['anonymous']})
except Exception as e:
......
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