Include email address for current API user info

This commit is contained in:
Lance Edgar 2022-12-04 09:39:08 -06:00
parent 4030904d40
commit ec71f532a1

View file

@ -101,6 +101,7 @@ class APIView(View):
return info return info
""" """
app = self.get_rattail_app() app = self.get_rattail_app()
auth_handler = app.get_auth_handler()
# basic / default info # basic / default info
is_admin = user.is_admin() is_admin = user.is_admin()
@ -113,6 +114,7 @@ class APIView(View):
'is_admin': is_admin, 'is_admin': is_admin,
'is_root': is_admin and self.request.session.get('is_root', False), 'is_root': is_admin and self.request.session.get('is_root', False),
'employee_uuid': employee.uuid if employee else None, 'employee_uuid': employee.uuid if employee else None,
'email_address': auth_handler.get_email_address(user),
} }
# maybe get/use "extra" info # maybe get/use "extra" info