Commit 24552ea0 authored by haowang's avatar haowang

add roles in login get method

parent 34f24c51
......@@ -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