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

Merge branch 'haow/dev' into 'test'

add roles in login get method

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