Update usage of app handler per upstream changes
This commit is contained in:
parent
17ae06f9c1
commit
51cad13f5a
|
@ -2,7 +2,7 @@
|
||||||
################################################################################
|
################################################################################
|
||||||
#
|
#
|
||||||
# Rattail -- Retail Software Framework
|
# Rattail -- Retail Software Framework
|
||||||
# Copyright © 2010-2022 Lance Edgar
|
# Copyright © 2010-2023 Lance Edgar
|
||||||
#
|
#
|
||||||
# This file is part of Rattail.
|
# This file is part of Rattail.
|
||||||
#
|
#
|
||||||
|
@ -24,8 +24,6 @@
|
||||||
Tailbone Web API - Core Views
|
Tailbone Web API - Core Views
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import unicode_literals, absolute_import
|
|
||||||
|
|
||||||
from tailbone.views import View
|
from tailbone.views import View
|
||||||
|
|
||||||
|
|
||||||
|
@ -101,20 +99,20 @@ class APIView(View):
|
||||||
return info
|
return info
|
||||||
"""
|
"""
|
||||||
app = self.get_rattail_app()
|
app = self.get_rattail_app()
|
||||||
auth_handler = app.get_auth_handler()
|
auth = app.get_auth_handler()
|
||||||
|
|
||||||
# basic / default info
|
# basic / default info
|
||||||
is_admin = user.is_admin()
|
is_admin = user.is_admin()
|
||||||
employee = user.employee
|
employee = app.get_employee(user)
|
||||||
info = {
|
info = {
|
||||||
'uuid': user.uuid,
|
'uuid': user.uuid,
|
||||||
'username': user.username,
|
'username': user.username,
|
||||||
'display_name': user.display_name,
|
'display_name': user.display_name,
|
||||||
'short_name': user.get_short_name(),
|
'short_name': auth.get_short_display_name(user),
|
||||||
'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),
|
'email_address': app.get_contact_email_address(user),
|
||||||
}
|
}
|
||||||
|
|
||||||
# maybe get/use "extra" info
|
# maybe get/use "extra" info
|
||||||
|
|
Loading…
Reference in a new issue