Update usage of app handler per upstream changes

This commit is contained in:
Lance Edgar 2023-06-16 22:15:52 -05:00
parent 17ae06f9c1
commit 51cad13f5a

View file

@ -2,7 +2,7 @@
################################################################################
#
# Rattail -- Retail Software Framework
# Copyright © 2010-2022 Lance Edgar
# Copyright © 2010-2023 Lance Edgar
#
# This file is part of Rattail.
#
@ -24,8 +24,6 @@
Tailbone Web API - Core Views
"""
from __future__ import unicode_literals, absolute_import
from tailbone.views import View
@ -101,20 +99,20 @@ class APIView(View):
return info
"""
app = self.get_rattail_app()
auth_handler = app.get_auth_handler()
auth = app.get_auth_handler()
# basic / default info
is_admin = user.is_admin()
employee = user.employee
employee = app.get_employee(user)
info = {
'uuid': user.uuid,
'username': user.username,
'display_name': user.display_name,
'short_name': user.get_short_name(),
'short_name': auth.get_short_display_name(user),
'is_admin': is_admin,
'is_root': is_admin and self.request.session.get('is_root', False),
'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